From eb1090341f0a08f2bf803ec3ad8b6488034cbb85 Mon Sep 17 00:00:00 2001 From: yggverse Date: Wed, 11 Dec 2024 10:58:41 +0200 Subject: [PATCH] rename variable --- src/app/browser/window/tab/item/page.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/app/browser/window/tab/item/page.rs b/src/app/browser/window/tab/item/page.rs index 01dc0f5f..0ea8cbb2 100644 --- a/src/app/browser/window/tab/item/page.rs +++ b/src/app/browser/window/tab/item/page.rs @@ -974,14 +974,14 @@ fn snap_history(navigation: Rc) { } /// Format bytes to KB/MB/GB presentation -fn format_bytes(total: usize) -> String { - if total < 1024 { - format!("{} bytes", total) - } else if total < 1024 * 1024 { - format!("{:.2} KB", total as f64 / 1024.0) - } else if total < 1024 * 1024 * 1024 { - format!("{:.2} MB", total as f64 / (1024.0 * 1024.0)) +fn format_bytes(value: usize) -> String { + if value < 1024 { + format!("{} bytes", value) + } else if value < 1024 * 1024 { + format!("{:.2} KB", value as f64 / 1024.0) + } else if value < 1024 * 1024 * 1024 { + format!("{:.2} MB", value as f64 / (1024.0 * 1024.0)) } else { - format!("{:.2} GB", total as f64 / (1024.0 * 1024.0 * 1024.0)) + format!("{:.2} GB", value as f64 / (1024.0 * 1024.0 * 1024.0)) } }