diff --git a/src/commands/list.rs b/src/commands/list.rs index 96543f0..518a7c2 100644 --- a/src/commands/list.rs +++ b/src/commands/list.rs @@ -70,7 +70,7 @@ impl<'a> Command<'a> for ListCommand { .collect(); streams.out.write_all(sheets.join("\n").as_bytes())?; - streams.out.write(b"\n")?; + streams.out.write_all(b"\n")?; } else { let mut total_running = Duration::seconds(0); let mut total_today = Duration::seconds(0); diff --git a/src/commands/now.rs b/src/commands/now.rs index b0f4d5c..7d1e70b 100644 --- a/src/commands/now.rs +++ b/src/commands/now.rs @@ -71,7 +71,7 @@ impl<'a> Command<'a> for NowCommand { }.to_string(), entry.sheet, format_duration(facts.now - entry.start), - entry.note.unwrap_or_else(|| "".to_string()) + entry.note.unwrap_or_default(), ]); } diff --git a/src/formatters/csv.rs b/src/formatters/csv.rs index fe4721c..14e6fb5 100644 --- a/src/formatters/csv.rs +++ b/src/formatters/csv.rs @@ -10,9 +10,9 @@ pub fn print_formatted(entries: Vec, out: &mut W, ids: bool) -> let mut wtr = Writer::from_writer(out); if ids { - wtr.write_record(&["id", "start", "end", "note", "sheet"])?; + wtr.write_record(["id", "start", "end", "note", "sheet"])?; } else { - wtr.write_record(&["start", "end", "note", "sheet"])?; + wtr.write_record(["start", "end", "note", "sheet"])?; } for entry in entries {