begin the rocket framework implementation, based on the aquatic-crawler fs

This commit is contained in:
yggverse 2025-08-05 02:07:22 +03:00
parent 7de9f2f93a
commit bbaa7c5f54
12 changed files with 409 additions and 545 deletions

17
src/format.rs Normal file
View file

@ -0,0 +1,17 @@
pub fn bytes(value: u64) -> String {
const KB: f32 = 1024.0;
const MB: f32 = KB * KB;
const GB: f32 = MB * KB;
let f = value as f32;
if f < KB {
format!("{value} B")
} else if f < MB {
format!("{:.2} KB", f / KB)
} else if f < GB {
format!("{:.2} MB", f / MB)
} else {
format!("{:.2} GB", f / GB)
}
}