This commit is contained in:
veeso
2023-02-09 17:20:48 +01:00
parent 62003308a7
commit 4d5f3a6b63
40 changed files with 139 additions and 147 deletions

View File

@@ -254,7 +254,7 @@ pub fn fmt_color(color: &Color) -> String {
Color::Rgb(255, 255, 0) => "yellow".to_string(),
Color::Rgb(154, 205, 50) => "yellowgreen".to_string(),
// -- others
Color::Rgb(r, g, b) => format!("#{:02x}{:02x}{:02x}", r, g, b),
Color::Rgb(r, g, b) => format!("#{r:02x}{g:02x}{b:02x}"),
}
}
@@ -280,7 +280,7 @@ pub fn fmt_bytes(v: u64) -> String {
} else if v >= 1024 {
format!("{} KB", v / 1024)
} else {
format!("{} B", v)
format!("{v} B")
}
}

View File

@@ -29,7 +29,7 @@ pub fn create_sample_file() -> NamedTempFile {
/// Create sample file with provided content
pub fn create_sample_file_with_content(content: impl std::fmt::Display) -> NamedTempFile {
let mut tmpfile: tempfile::NamedTempFile = tempfile::NamedTempFile::new().unwrap();
writeln!(tmpfile, "{}", content).unwrap();
writeln!(tmpfile, "{content}").unwrap();
tmpfile
}