From 01658b62b531641e021301fcae3f0c1e13752f0f Mon Sep 17 00:00:00 2001 From: "Andrew Phillips (aider)" Date: Fri, 9 May 2025 16:22:18 -0300 Subject: [PATCH] chore: remove unused utility functions --- src/main.rs | 42 ------------------------------------------ 1 file changed, 42 deletions(-) diff --git a/src/main.rs b/src/main.rs index 12fa26f..2a5c2f8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1153,45 +1153,3 @@ fn mode_status(_cmd: &mut Command, args: Args, data_path: PathBuf, db_path: Path Ok(()) } -fn get_meta_from_env() -> HashMap { - debug!("MAIN: Getting meta from KEEP_META_*"); - let re = Regex::new(r"^KEEP_META_(.+)$").unwrap(); - let mut meta_env: HashMap = HashMap::new(); - for (key, value) in env::vars() { - if let Some(meta_name_caps) = re.captures(key.as_str()) { - let name = String::from(meta_name_caps.get(1).unwrap().as_str()); - debug!("MAIN: Found meta: {}={}", name.clone(), value.clone()); - meta_env.insert(name, value.clone()); - } - } - meta_env -} - -fn format_size_human_readable(size: u64) -> String { - let options = humansize::FormatSizeOptions::from(BINARY) - .decimal_places(1); - - humansize::format_size(size, options) -} - -fn format_size(size: u64, human_readable: bool) -> String { - match human_readable { - true => format_size_human_readable(size), - false => size.to_string() - } -} - -fn string_column(s: String, column_width: usize) -> String { - if column_width > 0 { - match s.char_indices().nth(column_width) { - None => s.to_string(), - Some((idx, _)) => s[..idx].to_string(), - } - } else { - s.to_string() - } -} - -fn size_column(size: u64, human_readable: bool, column_width: usize) -> String { - string_column(format_size(size, human_readable), column_width) -}