diff --git a/Cargo.toml b/Cargo.toml index c0ea8b0..49b88b3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,30 +29,30 @@ futures-lite = "1.11.0" once_cell = "1.4.1" [dev-dependencies] -anyhow = "1.0.37" -async-dup = "1.2.2" -async-h1 = "2.3.0" -async-native-tls = "0.3.3" -async-tungstenite = { version = "0.13", features = ["async-native-tls"] } -ctrlc = "3.1.6" -doc-comment = "0.3.3" -futures = "0.3.8" -http = "0.2.2" -http-types = "2.9.0" -hyper = { version = "0.14.2", default-features = false, features = ["client", "http1", "server", "stream"] } -native-tls = "0.2.7" -scraper = "0.12.0" -signal-hook = "0.3.2" -surf = { version = "2.2", default-features = false, features = ["h1-client"] } -tempfile = "3.2.0" -tokio = { version = "1.0.1", default-features = false, features = ["rt-multi-thread"] } -tungstenite = "0.13" -url = "2.2.0" +anyhow = "1" +async-dup = "1" +async-h1 = "2" +async-native-tls = "0.4" +async-tungstenite = { version = "0.16", features = ["async-native-tls"] } +ctrlc = "3" +doc-comment = "0.3" +futures = "0.3" +http = "0.2" +http-types = "2" +hyper = { version = "0.14", default-features = false, features = ["client", "http1", "server", "stream"] } +native-tls = "0.2" +scraper = "0.12" +signal-hook = "0.3" +surf = { version = "2", default-features = false, features = ["h1-client"] } +tempfile = "3" +tokio = { version = "1", default-features = false, features = ["rt-multi-thread"] } +tungstenite = "0.16" +url = "2" [target.'cfg(target_os = "linux")'.dev-dependencies] -inotify = { version = "0.9.2", default-features = false } -nix = "0.21" -timerfd = "1.2.0" +inotify = { version = "0.10", default-features = false } +nix = "0.23" +timerfd = "1" [target.'cfg(windows)'.dev-dependencies] uds_windows = "1" diff --git a/examples/linux-timerfd.rs b/examples/linux-timerfd.rs index f53335f..888c5f3 100644 --- a/examples/linux-timerfd.rs +++ b/examples/linux-timerfd.rs @@ -14,14 +14,6 @@ fn main() -> std::io::Result<()> { use smol::{io, Async}; 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. @@ -30,7 +22,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(()) }