From 5311f269eb89e4b037019252920b4f35a960c606 Mon Sep 17 00:00:00 2001 From: "Steve Lee (POWERSHELL HE/HIM) (from Dev Box)" Date: Tue, 5 Mar 2024 11:03:25 -0800 Subject: [PATCH] pre-allocate string for table writer --- dsc/src/tablewriter.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dsc/src/tablewriter.rs b/dsc/src/tablewriter.rs index 4a6778b0..5c8c5d00 100644 --- a/dsc/src/tablewriter.rs +++ b/dsc/src/tablewriter.rs @@ -49,7 +49,7 @@ impl Table { let (width, _) = size().unwrap_or((80, 25)); // make header bright green println!("\x1b[1;32m"); - let mut header_row = String::new(); + let mut header_row = String::with_capacity(width as usize); let last_column = self.header.len() - 1; for (i, column) in self.header.iter().enumerate() { header_row.push_str(&format!("{: