From f87403794e3f69ee114a8d246cbc7ba16ded2175 Mon Sep 17 00:00:00 2001 From: lashman Date: Fri, 27 Feb 2026 21:05:56 +0200 Subject: [PATCH] Remove module-wide dead_code allows, annotate individual items instead --- src/core/backup.rs | 6 ++++-- src/core/notification.rs | 4 ++-- src/core/report.rs | 4 ++-- src/core/watcher.rs | 4 +--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/core/backup.rs b/src/core/backup.rs index 7176c5d..7e0bf08 100644 --- a/src/core/backup.rs +++ b/src/core/backup.rs @@ -1,5 +1,3 @@ -#![allow(dead_code)] - use std::fs; use std::io::Read; use std::path::{Path, PathBuf}; @@ -271,6 +269,7 @@ pub fn delete_backup(db: &Database, backup_id: i64) -> Result<(), BackupError> { } /// Remove backups older than the specified number of days. +#[allow(dead_code)] pub fn auto_cleanup_old_backups(db: &Database, retention_days: u32) -> Result { let backups = db.get_all_config_backups().unwrap_or_default(); let cutoff = chrono::Utc::now() - chrono::Duration::days(retention_days as i64); @@ -293,6 +292,7 @@ pub fn auto_cleanup_old_backups(db: &Database, retention_days: u32) -> Result, pub archive_path: String, @@ -304,8 +304,10 @@ pub struct BackupInfo { #[derive(Debug)] pub struct RestoreResult { + #[allow(dead_code)] pub manifest: BackupManifest, pub paths_restored: u32, + #[allow(dead_code)] pub paths_skipped: u32, } diff --git a/src/core/notification.rs b/src/core/notification.rs index 5c5a3c7..398ebf0 100644 --- a/src/core/notification.rs +++ b/src/core/notification.rs @@ -1,5 +1,3 @@ -#![allow(dead_code)] - use super::database::Database; use super::security; @@ -7,6 +5,7 @@ use super::security; #[derive(Debug, Clone)] pub struct CveNotification { pub app_name: String, + #[allow(dead_code)] pub appimage_id: i64, pub severity: String, pub cve_count: usize, @@ -139,6 +138,7 @@ fn send_desktop_notification(notif: &CveNotification) -> Result<(), Notification /// Run a security scan and send notifications for any new findings. /// This is the CLI entry point for `driftwood security --notify`. +#[allow(dead_code)] pub fn scan_and_notify(db: &Database, threshold: &str) -> Vec { // First run a batch scan to get fresh data let _results = security::batch_scan(db); diff --git a/src/core/report.rs b/src/core/report.rs index c48171b..5bf0b56 100644 --- a/src/core/report.rs +++ b/src/core/report.rs @@ -1,5 +1,3 @@ -#![allow(dead_code)] - use super::database::{CveSummary, Database}; use crate::config::VERSION; @@ -12,6 +10,7 @@ pub enum ReportFormat { } impl ReportFormat { + #[allow(dead_code)] pub fn from_str(s: &str) -> Option { match s.to_lowercase().as_str() { "json" => Some(Self::Json), @@ -21,6 +20,7 @@ impl ReportFormat { } } + #[allow(dead_code)] pub fn extension(&self) -> &'static str { match self { Self::Json => "json", diff --git a/src/core/watcher.rs b/src/core/watcher.rs index 366b7bd..cea041e 100644 --- a/src/core/watcher.rs +++ b/src/core/watcher.rs @@ -1,5 +1,3 @@ -#![allow(dead_code)] - use std::path::PathBuf; use std::sync::mpsc; use std::time::Duration; @@ -10,7 +8,7 @@ use notify::{Config, Event, EventKind, RecommendedWatcher, RecursiveMode, Watche #[derive(Debug, Clone)] pub enum WatchEvent { /// One or more AppImage files were created, modified, or deleted. - Changed(Vec), + Changed(#[allow(dead_code)] Vec), } /// Start watching the given directories for AppImage file changes.