Skip to main content

thoughts_tool/utils/
mod.rs

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