From 7b20b121d9b76208c31687264d5aa425ddaeeb1c Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Sat, 6 Dec 2025 14:43:29 +0100 Subject: [PATCH] Remove unused code and fix compiler warnings --- src/player/mod.rs | 9 --------- src/state/mod.rs | 20 -------------------- src/ui/theme.rs | 16 ---------------- 3 files changed, 45 deletions(-) diff --git a/src/player/mod.rs b/src/player/mod.rs index 3c73256..4866492 100644 --- a/src/player/mod.rs +++ b/src/player/mod.rs @@ -130,11 +130,6 @@ impl Player { Ok(()) } - pub fn stop(&mut self) -> Result<()> { - self.send_command("stop", &[])?; - self.is_idle = true; - Ok(()) - } pub fn set_volume(&mut self, volume: i64) -> Result<()> { self.send_command("set_property", &[json!("volume"), json!(volume)])?; @@ -179,10 +174,6 @@ impl Player { Some(self.duration) } - pub fn is_playing(&self) -> bool { - !self.is_paused && !self.is_idle - } - pub fn is_idle(&self) -> bool { self.is_idle } diff --git a/src/state/mod.rs b/src/state/mod.rs index e57f1b4..4fd5bd6 100644 --- a/src/state/mod.rs +++ b/src/state/mod.rs @@ -39,7 +39,6 @@ pub struct AppState { pub struct FlattenedItem { pub node: FileTreeNode, pub depth: usize, - pub is_expanded: bool, } impl AppState { @@ -120,20 +119,6 @@ impl AppState { self.flattened_items.get(self.selected_index) } - pub fn toggle_expand(&mut self) { - if let Some(item) = self.get_selected_item() { - if item.node.is_dir { - let path = item.node.path.clone(); - if self.expanded_dirs.contains(&path) { - self.expanded_dirs.remove(&path); - } else { - self.expanded_dirs.insert(path); - } - self.rebuild_flattened_items(); - } - } - } - pub fn collapse_selected(&mut self) { if let Some(item) = self.get_selected_item() { if item.node.is_dir { @@ -167,10 +152,6 @@ impl AppState { } } - pub fn clear_marks(&mut self) { - self.marked_files.clear(); - } - pub fn clear_playlist(&mut self) { self.playlist.clear(); self.playlist_index = 0; @@ -469,7 +450,6 @@ fn flatten_tree(nodes: &[FileTreeNode], depth: usize, expanded_dirs: &HashSet Color { - Color::Rgb(215, 84, 0) // #d75400 - } - - pub fn normal_cyan() -> Color { - Color::Rgb(160, 160, 160) // #a0a0a0 - } - // Semantic mappings - pub fn primary_text() -> Color { - Color::Rgb(238, 238, 238) // #eeeeee - } - pub fn secondary_text() -> Color { Self::foreground() } @@ -75,10 +63,6 @@ impl Theme { Self::normal_yellow() } - pub fn error() -> Color { - Self::normal_red() - } - // Styles pub fn widget_border_style() -> Style { Style::default().fg(Self::border()).bg(Self::background())