Skip to content

Update dev-dependencies #74

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ signal-hook = "0.3"
tempfile = "3.1.0"

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

[target.'cfg(windows)'.dev-dependencies]
Expand Down
10 changes: 1 addition & 9 deletions examples/linux-timerfd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@ fn main() -> std::io::Result<()> {
use futures_lite::future;
use timerfd::{SetTimeFlags, TimerFd, TimerState};

/// Converts a [`nix::Error`] into [`std::io::Error`].
fn io_err(err: nix::Error) -> io::Error {
match err {
nix::Error::Sys(code) => code.into(),
err => io::Error::new(io::ErrorKind::Other, Box::new(err)),
}
}

/// Sleeps using an OS timer.
async fn sleep(dur: Duration) -> io::Result<()> {
// Create an OS timer.
Expand All @@ -32,7 +24,7 @@ fn main() -> std::io::Result<()> {

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