From 070c87c8cd1026b2adca08ba9b53682e9f5301c9 Mon Sep 17 00:00:00 2001 From: "Ethan P." Date: Sat, 10 Feb 2024 02:21:58 -0800 Subject: [PATCH] Replace clone with reference This avoids an unnecessary allocation and memory copy when printing the empty panel during line wrapping. --- src/printer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/printer.rs b/src/printer.rs index f413fdc3..8dec755e 100644 --- a/src/printer.rs +++ b/src/printer.rs @@ -705,7 +705,7 @@ impl<'a> Printer for InteractivePrinter<'a> { background_color ), self.ansi_style.to_reset_sequence(), - panel_wrap.clone().unwrap() + panel_wrap.as_ref().unwrap() )?; cursor = 0;