From 0f82b94fa0069942e07d1b5e8b22827328fe71ac Mon Sep 17 00:00:00 2001 From: John Nunley Date: Sun, 11 Jun 2023 09:03:47 -0700 Subject: [PATCH] Fix the deprecated function warning due to inotify (#138) --- .github/workflows/ci.yml | 2 +- Cargo.toml | 4 ++-- examples/linux-inotify.rs | 5 ++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2227486..069f965 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -112,7 +112,7 @@ jobs: os: [ubuntu-latest, windows-latest] # When updating this, the reminder to update the minimum supported # Rust version in Cargo.toml. - rust: ['1.48'] + rust: ['1.63'] steps: - uses: actions/checkout@v3 - name: Install Rust diff --git a/Cargo.toml b/Cargo.toml index fc0e20c..cdfcf12 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ name = "async-io" version = "1.13.0" authors = ["Stjepan Glavina "] edition = "2018" -rust-version = "1.48" +rust-version = "1.63" description = "Async I/O and timers" license = "Apache-2.0 OR MIT" repository = "https://github.com/smol-rs/async-io" @@ -49,7 +49,7 @@ signal-hook = "0.3" tempfile = "3" [target.'cfg(target_os = "linux")'.dev-dependencies] -inotify = { version = "0.10", default-features = false } +inotify = { version = "0.10.1", default-features = false } timerfd = "1" [target.'cfg(windows)'.dev-dependencies] diff --git a/examples/linux-inotify.rs b/examples/linux-inotify.rs index c168f63..376aff4 100644 --- a/examples/linux-inotify.rs +++ b/examples/linux-inotify.rs @@ -37,7 +37,10 @@ fn main() -> std::io::Result<()> { future::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!();