Skip to content

Commit

Permalink
Fix the deprecated function warning due to inotify (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
notgull authored Jun 11, 2023
1 parent 46a0205 commit 0f82b94
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name = "async-io"
version = "1.13.0"
authors = ["Stjepan Glavina <[email protected]>"]
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"
Expand Down Expand Up @@ -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]
Expand Down
5 changes: 4 additions & 1 deletion examples/linux-inotify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!();
Expand Down

0 comments on commit 0f82b94

Please sign in to comment.