Merge pull request #22 from PR0M3TH3AN/codex/remove-'removed'-comment-and-dead-code-attributes

Clean watcher module and remove dead_code allows
This commit is contained in:
thePR0M3TH3AN
2025-05-20 23:20:57 -04:00
committed by GitHub
2 changed files with 6 additions and 12 deletions

View File

@@ -37,7 +37,6 @@ use std::{fs, path::Path, sync::{Arc, Mutex}};
/// Main handle for interacting with a Marlin database. /// Main handle for interacting with a Marlin database.
pub struct Marlin { pub struct Marlin {
#[allow(dead_code)]
cfg: config::Config, cfg: config::Config,
conn: Connection, conn: Connection,
} }

View File

@@ -16,7 +16,6 @@ use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
use std::thread::{self, JoinHandle}; use std::thread::{self, JoinHandle};
use std::time::{Duration, Instant}; use std::time::{Duration, Instant};
// REMOVED: use std::fs; // <<<<<<<<<<<< THIS LINE WAS REMOVED
/// Configuration for the file watcher /// Configuration for the file watcher
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
@@ -127,7 +126,6 @@ impl EventDebouncer {
events events
} }
#[allow(dead_code)]
fn len(&self) -> usize { fn len(&self) -> usize {
self.events.len() self.events.len()
} }
@@ -318,13 +316,10 @@ mod event_debouncer_tests {
pub struct FileWatcher { pub struct FileWatcher {
state: Arc<Mutex<WatcherState>>, state: Arc<Mutex<WatcherState>>,
#[allow(dead_code)] _config: WatcherConfig,
config: WatcherConfig,
watched_paths: Vec<PathBuf>, watched_paths: Vec<PathBuf>,
#[allow(dead_code)] _event_receiver: Receiver<std::result::Result<Event, notify::Error>>,
event_receiver: Receiver<std::result::Result<Event, notify::Error>>, _watcher: RecommendedWatcher,
#[allow(dead_code)]
watcher: RecommendedWatcher,
processor_thread: Option<JoinHandle<()>>, processor_thread: Option<JoinHandle<()>>,
stop_flag: Arc<AtomicBool>, stop_flag: Arc<AtomicBool>,
events_processed: Arc<AtomicUsize>, events_processed: Arc<AtomicUsize>,
@@ -456,10 +451,10 @@ impl FileWatcher {
Ok(Self { Ok(Self {
state, state,
config, _config: config,
watched_paths: paths, watched_paths: paths,
event_receiver: rx, _event_receiver: rx,
watcher: actual_watcher, _watcher: actual_watcher,
processor_thread: Some(processor_thread), processor_thread: Some(processor_thread),
stop_flag, stop_flag,
events_processed, events_processed,