From 4604978cf0b5ea2f6b2d96d946aab372bdd70561 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Sun, 11 Jun 2023 17:57:00 +0900 Subject: [PATCH] Fix deprecated warning in example ``` error: use of deprecated method `inotify::Inotify::add_watch`: use `Inotify.watches().add()` instead --> examples/linux-inotify.rs:38:27 | 38 | inotify.get_mut().add_watch(".", WatchMask::ALL_EVENTS)?; | ^^^^^^^^^ | = note: `-D deprecated` implied by `-D warnings` ``` --- examples/linux-inotify.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/linux-inotify.rs b/examples/linux-inotify.rs index 10c73e3..16cb4dd 100644 --- a/examples/linux-inotify.rs +++ b/examples/linux-inotify.rs @@ -35,7 +35,10 @@ fn main() -> std::io::Result<()> { smol::block_on(async { // Watch events in the current directory. let mut inotify = Async::new(Inotify::init()?)?; - inotify.get_mut().add_watch(".", WatchMask::ALL_EVENTS)?; + inotify + .get_mut() + .watches() + .add(".", WatchMask::ALL_EVENTS)?; println!("Watching for filesystem events in the current directory..."); println!("Try opening a file to trigger some events."); println!();