Merge pull request #231 from smol-rs/deps

Update dev-dependencies
This commit is contained in:
Taiki Endo 2022-01-09 01:23:58 +09:00 committed by GitHub
commit c2f5bfcd61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 31 deletions

View File

@ -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"

View File

@ -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(())
}