Skip to content

Commit 0f82b94

Browse files
authored
Fix the deprecated function warning due to inotify (#138)
1 parent 46a0205 commit 0f82b94

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ jobs:
112112
os: [ubuntu-latest, windows-latest]
113113
# When updating this, the reminder to update the minimum supported
114114
# Rust version in Cargo.toml.
115-
rust: ['1.48']
115+
rust: ['1.63']
116116
steps:
117117
- uses: actions/checkout@v3
118118
- name: Install Rust

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ name = "async-io"
66
version = "1.13.0"
77
authors = ["Stjepan Glavina <[email protected]>"]
88
edition = "2018"
9-
rust-version = "1.48"
9+
rust-version = "1.63"
1010
description = "Async I/O and timers"
1111
license = "Apache-2.0 OR MIT"
1212
repository = "https://github.com/smol-rs/async-io"
@@ -49,7 +49,7 @@ signal-hook = "0.3"
4949
tempfile = "3"
5050

5151
[target.'cfg(target_os = "linux")'.dev-dependencies]
52-
inotify = { version = "0.10", default-features = false }
52+
inotify = { version = "0.10.1", default-features = false }
5353
timerfd = "1"
5454

5555
[target.'cfg(windows)'.dev-dependencies]

examples/linux-inotify.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ fn main() -> std::io::Result<()> {
3737
future::block_on(async {
3838
// Watch events in the current directory.
3939
let mut inotify = Async::new(Inotify::init()?)?;
40-
inotify.get_mut().add_watch(".", WatchMask::ALL_EVENTS)?;
40+
inotify
41+
.get_mut()
42+
.watches()
43+
.add(".", WatchMask::ALL_EVENTS)?;
4144
println!("Watching for filesystem events in the current directory...");
4245
println!("Try opening a file to trigger some events.");
4346
println!();

0 commit comments

Comments
 (0)