pub fn size_display<'a>(total_bytes: usize) -> (f64, &'a str) { let total_bytes = total_bytes as f64; if total_bytes >= 1024.0 * 1024.0 * 1024.0 * 1024.0 { (total_bytes / (1024.0 * 1024.0 * 1024.0 * 1024.0), "TB") } else if total_bytes >= 1024.0 * 1024.0 * 1024.0 { (total_bytes / (1024.0 * 1024.0 * 1024.0), "GB") } else if total_bytes >= 1024.0 * 1024.0 { (total_bytes / (1024.0 * 1024.0), "MB") } else if total_bytes >= 1024.0 { (total_bytes / 1024.0, "KB") } else { (total_bytes, "B") } }