chore: fix all compiler warnings

Add #[allow(dead_code)] to unused but potentially useful methods:
- config: save()
- filter: apps_only(), active_prefix()
- providers: name(), search(), is_dmenu_mode(), available_providers()
- dmenu: is_enabled()
- uuctl: ServiceState struct
- result_row: ResultRow struct

Prefix unused variables with underscore in main_window.rs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-28 15:00:30 +01:00
parent 26d8bab34d
commit a81bacce10
7 changed files with 13 additions and 2 deletions

View File

@@ -182,6 +182,7 @@ impl Config {
Ok(config)
}
#[allow(dead_code)]
pub fn save(&self) -> Result<(), Box<dyn std::error::Error>> {
let path = Self::config_path().ok_or("Could not determine config path")?;

View File

@@ -56,6 +56,7 @@ impl ProviderFilter {
}
/// Default filter: apps only
#[allow(dead_code)]
pub fn apps_only() -> Self {
Self {
enabled: HashSet::from([ProviderType::Application]),
@@ -115,6 +116,7 @@ impl ProviderFilter {
}
/// Get current active prefix if any
#[allow(dead_code)]
pub fn active_prefix(&self) -> Option<ProviderType> {
self.active_prefix
}

View File

@@ -37,6 +37,7 @@ impl DmenuProvider {
self.enabled = true;
}
#[allow(dead_code)]
pub fn is_enabled(&self) -> bool {
self.enabled
}

View File

@@ -14,6 +14,7 @@ use fuzzy_matcher::skim::SkimMatcherV2;
/// Represents a single searchable/launchable item
#[derive(Debug, Clone)]
pub struct LaunchItem {
#[allow(dead_code)]
pub id: String,
pub name: String,
pub description: Option<String>,
@@ -58,6 +59,7 @@ impl std::fmt::Display for ProviderType {
/// Trait for all search providers
pub trait Provider: Send {
#[allow(dead_code)]
fn name(&self) -> &str;
fn provider_type(&self) -> ProviderType;
fn refresh(&mut self);
@@ -98,6 +100,7 @@ impl ProviderManager {
manager
}
#[allow(dead_code)]
pub fn is_dmenu_mode(&self) -> bool {
self.providers
.iter()
@@ -110,6 +113,7 @@ impl ProviderManager {
}
}
#[allow(dead_code)]
pub fn search(&self, query: &str, max_results: usize) -> Vec<(LaunchItem, i64)> {
if query.is_empty() {
// Return recent/popular items when query is empty
@@ -197,6 +201,7 @@ impl ProviderManager {
}
/// Get all available provider types (for UI tabs)
#[allow(dead_code)]
pub fn available_providers(&self) -> Vec<ProviderType> {
self.providers.iter().map(|p| p.provider_type()).collect()
}

View File

@@ -9,6 +9,7 @@ pub struct UuctlProvider {
}
/// Represents the state of a systemd service
#[allow(dead_code)]
#[derive(Debug, Clone)]
pub struct ServiceState {
pub unit_name: String,

View File

@@ -505,8 +505,8 @@ impl MainWindow {
let results_list = self.results_list.clone();
let scrolled = self.scrolled.clone();
let search_entry = self.search_entry.clone();
let current_results = self.current_results.clone();
let config = self.config.clone();
let _current_results = self.current_results.clone();
let _config = self.config.clone();
let filter = self.filter.clone();
let filter_buttons = self.filter_buttons.clone();
let mode_label = self.mode_label.clone();

View File

@@ -2,6 +2,7 @@ use crate::providers::LaunchItem;
use gtk4::prelude::*;
use gtk4::{Box as GtkBox, Image, Label, ListBoxRow, Orientation};
#[allow(dead_code)]
pub struct ResultRow {
row: ListBoxRow,
}