diff --git a/examples/watcher_kind/src/main.rs b/examples/watcher_kind/src/main.rs index 5324e1e0..1b0227ea 100644 --- a/examples/watcher_kind/src/main.rs +++ b/examples/watcher_kind/src/main.rs @@ -1,10 +1,14 @@ use std::time::Duration; -use notify::*; +use notify::{poll::PollWatcherConfig, *}; fn main() { - let (tx, rx) = std::sync::mpsc::channel(); - let watcher: Box = if RecommendedWatcher::kind() == WatcherKind::PollWatcher { - Box::new(PollWatcher::with_delay(tx, Duration::from_secs(1)).unwrap()) + let (tx, _rx) = std::sync::mpsc::channel(); + let _watcher: Box = if RecommendedWatcher::kind() == WatcherKind::PollWatcher { + let config = PollWatcherConfig { + poll_interval: Duration::from_secs(1), + ..Default::default() + }; + Box::new(PollWatcher::with_config(tx, config).unwrap()) } else { Box::new(RecommendedWatcher::new(tx).unwrap()) }; diff --git a/src/poll.rs b/src/poll.rs index 026fce57..b8913f70 100644 --- a/src/poll.rs +++ b/src/poll.rs @@ -386,7 +386,7 @@ impl Watcher for PollWatcher { /// Create a new [PollWatcher]. /// /// The default poll frequency is 30 seconds. - /// Use [with_delay] to manually set the poll frequency. + /// Use [with_config] to manually set the poll frequency. fn new(event_handler: F) -> Result { Self::with_config(event_handler, PollWatcherConfig::default()) }