diff --git a/Cargo.lock b/Cargo.lock index 0196373..b028023 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -166,9 +166,9 @@ dependencies = [ [[package]] name = "notify" -version = "5.0.0-pre.15" +version = "5.0.0-pre.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "553f9844ad0b0824605c20fb55a661679782680410abfb1a8144c2e7e437e7a7" +checksum = "530f6314d6904508082f4ea424a0275cf62d341e118b313663f266429cb19693" dependencies = [ "bitflags", "crossbeam-channel", diff --git a/src/lib.rs b/src/lib.rs index 86ab07b..0fe83a8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -12,8 +12,9 @@ use pyo3::exceptions::{PyFileNotFoundError, PyRuntimeError, PyTypeError}; use pyo3::prelude::*; use notify::event::{Event, EventKind, ModifyKind, RenameMode}; -use notify::poll::PollWatcherConfig; -use notify::{ErrorKind, PollWatcher, RecommendedWatcher, RecursiveMode, Result as NotifyResult, Watcher}; +use notify::{ + Config as NotifyConfig, ErrorKind, PollWatcher, RecommendedWatcher, RecursiveMode, Result as NotifyResult, Watcher, +}; create_exception!( _rust_notify, @@ -134,11 +135,8 @@ impl RustNotify { macro_rules! create_poll_watcher { ($msg_template:literal) => {{ let delay = Duration::from_millis(poll_delay_ms); - let config = PollWatcherConfig { - poll_interval: delay, - compare_contents: false, - }; - let mut watcher = match PollWatcher::with_config(event_handler, config) { + let config = NotifyConfig::default().with_poll_interval(delay); + let mut watcher = match PollWatcher::new(event_handler, config) { Ok(watcher) => watcher, Err(e) => return wf_error!($msg_template, e), }; @@ -150,7 +148,7 @@ impl RustNotify { let watcher: WatcherEnum = match force_polling { true => create_poll_watcher!("Error creating poll watcher: {}"), false => { - match RecommendedWatcher::new(event_handler.clone()) { + match RecommendedWatcher::new(event_handler.clone(), NotifyConfig::default()) { Ok(watcher) => { let mut watcher = watcher; watcher_paths!(watcher, watch_paths, debug);