diff --git a/app/src-tauri/src/marketplace/tree.rs b/app/src-tauri/src/marketplace/tree.rs index 4a11489..d41ce3b 100644 --- a/app/src-tauri/src/marketplace/tree.rs +++ b/app/src-tauri/src/marketplace/tree.rs @@ -53,9 +53,9 @@ pub enum ReadError { pub(crate) fn describe_size(bytes: u64) -> String { const KIB: u64 = 1024; const MIB: u64 = 1024 * 1024; - if bytes >= MIB && bytes % MIB == 0 { + if bytes >= MIB && bytes.is_multiple_of(MIB) { format!("{} MiB", bytes / MIB) - } else if bytes >= KIB && bytes % KIB == 0 { + } else if bytes >= KIB && bytes.is_multiple_of(KIB) { format!("{} KiB", bytes / KIB) } else { format!("{} bytes", bytes)