Skip to content

Commit b0af11c

Browse files
committed
Update dev-dependencies
1 parent eaf1bbc commit b0af11c

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ signal-hook = "0.3"
4141
tempfile = "3.1.0"
4242

4343
[target.'cfg(target_os = "linux")'.dev-dependencies]
44-
inotify = { version = "0.9", default-features = false }
45-
nix = "0.21"
44+
inotify = { version = "0.10", default-features = false }
45+
nix = "0.23"
4646
timerfd = "1.1.1"
4747

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

examples/linux-timerfd.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,6 @@ fn main() -> std::io::Result<()> {
1616
use futures_lite::future;
1717
use timerfd::{SetTimeFlags, TimerFd, TimerState};
1818

19-
/// Converts a [`nix::Error`] into [`std::io::Error`].
20-
fn io_err(err: nix::Error) -> io::Error {
21-
match err {
22-
nix::Error::Sys(code) => code.into(),
23-
err => io::Error::new(io::ErrorKind::Other, Box::new(err)),
24-
}
25-
}
26-
2719
/// Sleeps using an OS timer.
2820
async fn sleep(dur: Duration) -> io::Result<()> {
2921
// Create an OS timer.
@@ -32,7 +24,7 @@ fn main() -> std::io::Result<()> {
3224

3325
// When the OS timer fires, a 64-bit integer can be read from it.
3426
Async::new(timer)?
35-
.read_with(|t| nix::unistd::read(t.as_raw_fd(), &mut [0u8; 8]).map_err(io_err))
27+
.read_with(|t| nix::unistd::read(t.as_raw_fd(), &mut [0u8; 8]).map_err(io::Error::from))
3628
.await?;
3729
Ok(())
3830
}

0 commit comments

Comments
 (0)