Marketplace: use is_multiple_of in describe_size (clippy)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-27 13:13:48 -07:00
co-authored by Claude Opus 5.5
parent 8ec033f923
commit 973e51f969
+2 -2
View File
@@ -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)