Skip to main content

thoughts_tool/utils/
mod.rs

1pub mod claude_settings;
2pub mod git;
3pub mod logging;
4pub mod paths;
5pub mod validation;
6
7/// Format bytes as human-readable size.
8pub fn human_size(bytes: u64) -> String {
9    match bytes {
10        0 => "0 B".into(),
11        1..=1023 => format!("{} B", bytes),
12        1024..=1048575 => format!("{:.1} KB", (bytes as f64) / 1024.0),
13        _ => format!("{:.1} MB", (bytes as f64) / (1024.0 * 1024.0)),
14    }
15}