Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
0xpr03 committed Jun 17, 2022
1 parent ed242d1 commit e9fbc59
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
11 changes: 3 additions & 8 deletions src/debouncer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ use std::{
path::PathBuf,
sync::{
mpsc::{self, Receiver},
Arc, Mutex, MutexGuard,
Arc, Mutex,
},
time::{Duration, Instant},
};

use crate::{
event::{MetadataKind, ModifyKind},
event::ModifyKind,
Error, ErrorKind, Event, EventKind, RecommendedWatcher, Watcher,
};

Expand All @@ -28,8 +28,6 @@ struct EventData {
/// See also https://github.com/notify-rs/notify/wiki/The-Event-Guide#platform-specific-behaviour for more information.
#[derive(Eq, PartialEq, Clone)]
pub enum DebouncedEvent {
// NoticeWrite(PathBuf),
// NoticeRemove(PathBuf),
/// When precise events are disabled for files
Any,
/// Access performed
Expand All @@ -44,9 +42,6 @@ pub enum DebouncedEvent {
Metadata,
/// File deleted
Remove,
// Rename(PathBuf, PathBuf),
// Rescan,
// Error(Error, Option<PathBuf>),
}

impl From<DebouncedEvent> for EventData {
Expand Down Expand Up @@ -219,7 +214,7 @@ pub fn new_debouncer(
}
});

let watcher = RecommendedWatcher::new_immediate(move |e: Result<Event, Error>| {
let watcher = RecommendedWatcher::new(move |e: Result<Event, Error>| {
if let Ok(e) = e {
let mut lock = data.lock().expect("Can't lock debouncer data!");
lock.add_event(e);
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ pub use config::{Config, RecursiveMode};
pub use debouncer::new_debouncer;
pub use error::{Error, ErrorKind, Result};
pub use event::{Event, EventKind};
use std::convert::AsRef;
use std::path::Path;

#[cfg(all(target_os = "macos", not(feature = "macos_kqueue")))]
Expand Down

0 comments on commit e9fbc59

Please sign in to comment.