summaryrefslogtreecommitdiffstats
path: root/src/units.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-26 21:56:20 +0100
committertv <tv@krebsco.de>2026-10-26 21:56:20 +0100
commit08f5df1f0a2e22876a5b49a4f9e2e05a61df882a (patch)
tree113050df0bef5e8f3e9d188c69fc2a0c76d2eb17 /src/units.rs
parentecdb3ee944f5c171faac3a71117e2ff27e064295 (diff)
make clippy happy again
Diffstat (limited to 'src/units.rs')
-rw-r--r--src/units.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/units.rs b/src/units.rs
index cec5ffc..ac08ebf 100644
--- a/src/units.rs
+++ b/src/units.rs
@@ -134,7 +134,7 @@ pub(crate) fn parse_size(text: &str) -> Result<u64, String> {
pub(crate) fn format_size(bytes: u64) -> String {
SIZE_UNITS
.iter()
- .find(|(_, scale)| bytes != 0 && bytes % scale == 0)
+ .find(|(_, scale)| bytes != 0 && bytes.is_multiple_of(*scale))
.map(|(name, scale)| format!("{}{name}", bytes / scale))
.unwrap_or_else(|| "0B".to_owned())
}