From 9f1f19db49a84d27803efbb8b3effc5e5aa3801f Mon Sep 17 00:00:00 2001 From: fukusuket <41001169+fukusuket@users.noreply.github.com> Date: Tue, 12 Nov 2024 17:01:56 +0900 Subject: [PATCH] =?UTF-8?q?chg:=20separator=20char=20","=20->=20"=C2=A6"?= =?UTF-8?q?=20or=20"\n"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/timeline/timelines.rs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/timeline/timelines.rs b/src/timeline/timelines.rs index a8e1d05f7..3c9131691 100644 --- a/src/timeline/timelines.rs +++ b/src/timeline/timelines.rs @@ -500,7 +500,7 @@ impl Timeline { let header = vec![ "Filename", "Computers", - "Event Count", + "Events", "First Timestamp", "Last Timestamp", "Channels", @@ -511,7 +511,7 @@ impl Timeline { let mut wrt = WriterBuilder::new().from_writer(file); let _ = wrt.write_record(header); for rec in &mut *log_metrics { - let _ = wrt.write_record(Self::create_record_array(rec, stored_static)); + let _ = wrt.write_record(Self::create_record_array(rec, stored_static, "¦")); } } else { let mut tb = Table::new(); @@ -520,7 +520,7 @@ impl Timeline { .set_content_arrangement(ContentArrangement::DynamicFullWidth) .set_header(&header); for rec in &mut *log_metrics { - let r = Self::create_record_array(rec, stored_static); + let r = Self::create_record_array(rec, stored_static, "\n"); tb.add_row(vec![ Cell::new(r[0].to_string()), Cell::new(r[1].to_string()), @@ -536,7 +536,11 @@ impl Timeline { } } - fn create_record_array(rec: &LogMetrics, stored_static: &StoredStatic) -> [String; 7] { + fn create_record_array( + rec: &LogMetrics, + stored_static: &StoredStatic, + sep: &str, + ) -> [String; 7] { let ab_ch: Vec = rec .channels .iter() @@ -549,12 +553,12 @@ impl Timeline { .collect(); [ rec.filename.to_string(), - rec.computers.iter().sorted().join(","), + rec.computers.iter().sorted().join(sep), rec.event_count.to_formatted_string(&Locale::en), rec.first_timestamp.unwrap_or_default().to_string(), rec.last_timestamp.unwrap_or_default().to_string(), - ab_ch.iter().sorted().join(","), - ab_provider.iter().sorted().join(","), + ab_ch.iter().sorted().join(sep), + ab_provider.iter().sorted().join(sep), ] } }