clippy lints

This commit is contained in:
Abraham Toriz 2022-11-05 20:34:35 -06:00
parent 3fa0509319
commit bc2b96d425
No known key found for this signature in database
GPG Key ID: D5B4A746DB5DD42A
3 changed files with 4 additions and 4 deletions

View File

@ -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);

View File

@ -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(),
]);
}

View File

@ -10,9 +10,9 @@ pub fn print_formatted<W: Write>(entries: Vec<Entry>, 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 {