From 54b1f74ff185bceca625df43ecfd0148d181b34c Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Sat, 24 Aug 2024 02:32:59 -0700 Subject: [PATCH 1/1] Refactor: Collect to Vec and join(" ") --- src/lib.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index c261c78..e636bb2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -150,8 +150,8 @@ fn column_order(rows: &[RowInput]) -> Vec { fn render_instance(entry: &Entry) -> String { match &entry.instance { - None => String::from("✓ "), - Some(instance) => String::from(instance) + " ", + None => String::from("✓"), + Some(instance) => String::from(instance), } } @@ -169,9 +169,10 @@ fn render_cell(col: &str, row: &RowInput) -> String { entries .iter() .map(|i| render_instance(i)) - .collect::() + .collect::>() + .join(" ") }; - format!("{}", contents.trim()) + format!("{contents}") } fn render_row(columns: &[String], row: &RowInput) -> String { -- 2.44.1