Apply cargo clippy suggestions
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
#![allow(dead_code)]
|
||||
|
||||
use std::fmt::Write;
|
||||
|
||||
/// Returns a human readable String of a Duration
|
||||
///
|
||||
/// Example: `3h 12m 53s`
|
||||
@@ -7,7 +9,7 @@ pub fn format_duration(d: &std::time::Duration) -> String {
|
||||
let mut s = String::new();
|
||||
let mut append_unit = |value, unit| {
|
||||
if value > 0 {
|
||||
s.push_str(&format!("{}{}", value, unit));
|
||||
let _ = write!(s, "{}{}", value, unit);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user