Skip to content

Commit

Permalink
chg: separator char "," -> "¦" or "\n"
Browse files Browse the repository at this point in the history
  • Loading branch information
fukusuket committed Nov 12, 2024
1 parent 38da485 commit 9f1f19d
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/timeline/timelines.rs
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ impl Timeline {
let header = vec![
"Filename",
"Computers",
"Event Count",
"Events",
"First Timestamp",
"Last Timestamp",
"Channels",
Expand All @@ -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();
Expand All @@ -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()),
Expand All @@ -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<String> = rec
.channels
.iter()
Expand All @@ -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),
]
}
}
Expand Down

0 comments on commit 9f1f19d

Please sign in to comment.