Skip to content

Commit

Permalink
solve Clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
marcospb19 committed Dec 25, 2022
1 parent f64d1b7 commit ccebf4b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ fn main() -> anyhow::Result<()> {
),
Err(e) => error!(
"{:?}",
e.context(format!("Failed to clean {:?}", project_path))
e.context(format!("Failed to clean {project_path:?}"))
),
};
}
Expand Down
4 changes: 2 additions & 2 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ pub fn format_bytes(bytes: u64) -> String {
let mut bytes = bytes as f64;
for prefix in prefixes.iter() {
if bytes < 1024. {
return format!("{:.2} {}", bytes, prefix);
return format!("{bytes:.2} {prefix}");
}
bytes /= 1024.;
}
format!("{} TiB", bytes)
format!("{bytes} TiB")
}

#[cfg(test)]
Expand Down
5 changes: 1 addition & 4 deletions tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,7 @@ fn count_cleaned(target: &TempDir, args: &[&str], old_size: u64) -> Result<u64>
let one_percent = old_size as f64 * 0.01;
assert!(
diff <= one_percent as u64,
"new_size={}, old_size={}, cleaned={}, diff={diff}, 1%={one_percent}",
new_size,
old_size,
cleaned
"new_size={new_size}, old_size={old_size}, cleaned={cleaned}, diff={diff}, 1%={one_percent}"
);

Ok(cleaned)
Expand Down

0 comments on commit ccebf4b

Please sign in to comment.