From eb7790ff8f0058ce8107686511aeffa90c4f44e0 Mon Sep 17 00:00:00 2001 From: Ian Keane Date: Sun, 23 Nov 2025 12:11:46 -0500 Subject: [PATCH] Remove vestigial code --- src/app.rs | 22 +++++++--------------- src/config.rs | 8 +------- src/state.rs | 1 + src/ui.rs | 6 +----- 4 files changed, 10 insertions(+), 27 deletions(-) diff --git a/src/app.rs b/src/app.rs index f1ddf27..7e99729 100644 --- a/src/app.rs +++ b/src/app.rs @@ -462,9 +462,6 @@ impl App { } fn format_log_entries(&mut self) { - use chrono::{DateTime, Local, Timelike}; - use std::collections::BTreeMap; - if self.log_view_frames.is_empty() { self.log_view_content = vec!["No log entries for this period.".to_string()]; return; @@ -829,20 +826,16 @@ impl App { fn jump_to_previous_project(&mut self) { // Find the previous project and jump to its first entry - let mut current_date = String::new(); let mut current_project = String::new(); - let mut selected_project = String::new(); - let mut selected_date = String::new(); + let mut _selected_project = String::new(); let mut frame_count = 0; let mut previous_project_first_entry = None; let mut last_different_project_entry = None; // Find which project we're currently in for line in &self.log_view_content.clone() { - if !line.starts_with('\t') && !line.is_empty() && !line.starts_with(" ") { - current_date = line.clone(); - } else if line.starts_with(" ") && !line.starts_with("\t") { - if !current_project.is_empty() && current_project != selected_project { + if line.starts_with(" ") && !line.starts_with("\t") { + if !current_project.is_empty() && current_project != _selected_project { last_different_project_entry = previous_project_first_entry; } current_project = line.clone(); @@ -851,8 +844,7 @@ impl App { if self.is_entry_line(line) { if frame_count == self.log_view_selected { - selected_project = current_project.clone(); - selected_date = current_date.clone(); + _selected_project = current_project.clone(); // Jump to the last different project we saw if let Some(entry) = last_different_project_entry { self.log_view_selected = entry; @@ -920,7 +912,7 @@ impl App { fn jump_to_previous_day(&mut self) { // Find the previous day and jump to its first entry let mut current_date = String::new(); - let mut selected_date = String::new(); + let mut _selected_date = String::new(); let mut frame_count = 0; let mut last_different_day_entry = None; let mut previous_day_first_entry = None; @@ -928,7 +920,7 @@ impl App { // Find which day we're currently in for line in &self.log_view_content.clone() { if !line.starts_with('\t') && !line.is_empty() && !line.starts_with(" ") { - if !current_date.is_empty() && current_date != selected_date { + if !current_date.is_empty() && current_date != _selected_date { last_different_day_entry = previous_day_first_entry; } current_date = line.clone(); @@ -937,7 +929,7 @@ impl App { if self.is_entry_line(line) { if frame_count == self.log_view_selected { - selected_date = current_date.clone(); + _selected_date = current_date.clone(); // Jump to the last different day we saw if let Some(entry) = last_different_day_entry { self.log_view_selected = entry; diff --git a/src/config.rs b/src/config.rs index 7c4abc2..f9aa9e0 100644 --- a/src/config.rs +++ b/src/config.rs @@ -5,8 +5,6 @@ use std::path::PathBuf; pub struct Config { #[serde(default = "default_show_help_hint")] pub show_help_hint: bool, - #[serde(default = "default_show_command_hints")] - pub show_command_hints: bool, #[serde(default = "Vec::new")] pub projects: Vec, #[serde(default = "default_strict_projects")] @@ -17,10 +15,6 @@ fn default_show_help_hint() -> bool { true } -fn default_show_command_hints() -> bool { - true -} - fn default_strict_projects() -> bool { false } @@ -29,7 +23,6 @@ impl Default for Config { fn default() -> Self { Self { show_help_hint: default_show_help_hint(), - show_command_hints: default_show_command_hints(), projects: Vec::new(), strict_projects: default_strict_projects(), } @@ -49,6 +42,7 @@ impl Config { Ok(serde_yaml::from_str(&contents)?) } + #[allow(dead_code)] pub fn save(&self) -> anyhow::Result<()> { let path = Self::config_path()?; let yaml = serde_yaml::to_string(&self)?; diff --git a/src/state.rs b/src/state.rs index 5a735d0..9d4e68d 100644 --- a/src/state.rs +++ b/src/state.rs @@ -69,6 +69,7 @@ impl AppState { Ok(()) } + #[allow(dead_code)] pub fn add_recent_item(&mut self, item: TimeItem) { self.recent_items.insert(0, item); if self.recent_items.len() > 20 { diff --git a/src/ui.rs b/src/ui.rs index 481cd1b..6f49af2 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -281,9 +281,6 @@ fn render_config_help(frame: &mut Frame, _app: &App) { "show_help_hint: true/false", " Controls visibility of the help hint in the bottom bar", "", - "show_command_hints: true/false", - " Controls visibility of command hints in the bottom bar", - "", "projects: [list of strings]", " List of available project names", "", @@ -292,7 +289,6 @@ fn render_config_help(frame: &mut Frame, _app: &App) { "", "Example configuration:", "show_help_hint: true", - "show_command_hints: true", "projects:", " - project1", " - project2", @@ -477,7 +473,7 @@ fn render_log_view(frame: &mut Frame, app: &App) { // Determine what counts as an entry based on grouping mode let is_by_project = matches!(app.log_view_grouping, LogViewGrouping::ByProject); - for (idx, line) in app.log_view_content.iter().enumerate() { + for (_idx, line) in app.log_view_content.iter().enumerate() { if !line.starts_with('\t') && !line.is_empty() && !line.starts_with(" ") { current_date = line.clone(); } else if line.starts_with(" ") && !line.starts_with("\t") {