diff --git a/Cargo.toml b/Cargo.toml index 2823bf1..6aedd43 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,11 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -rustix = "0.34.0" +rustix = { version = "0.35.0", default-features = false, features = [ + "fs", + "net", + "std", +] } [dev-dependencies] read-write-buf = { git = "https://git.asonix.dog/safe-async/read-write-buf" } diff --git a/src/io.rs b/src/io.rs index 41194c1..ce8582e 100644 --- a/src/io.rs +++ b/src/io.rs @@ -69,7 +69,7 @@ pub fn try_ready(fd: &A, interest: Readiness) -> Result(res: rustix::io::Result) -> Result> { match res { Ok(t) => Ok(InProgress::Ready(t)), - Err(e) if e == rustix::io::Error::INPROGRESS => Ok(InProgress::InProgress), + Err(e) if e == rustix::io::Errno::INPROGRESS => Ok(InProgress::InProgress), Err(e) => Err(e.into()), } } @@ -77,7 +77,7 @@ pub(crate) fn in_progress(res: rustix::io::Result) -> Result pub(crate) fn nonblocking(res: rustix::io::Result) -> Result> { match res { Ok(t) => Ok(Nonblocking::Ready(t)), - Err(e) if e == rustix::io::Error::WOULDBLOCK || e == rustix::io::Error::AGAIN => { + Err(e) if e == rustix::io::Errno::WOULDBLOCK || e == rustix::io::Errno::AGAIN => { Ok(Nonblocking::WouldBlock) } Err(e) => Err(e.into()), diff --git a/src/lib.rs b/src/lib.rs index 22f2007..7e8a2eb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -198,7 +198,7 @@ impl PollManager { let mut buf = [0; 16]; loop { if let Err(e) = rustix::io::read(&self.notify, &mut buf) { - if e == rustix::io::Error::AGAIN || e == rustix::io::Error::WOULDBLOCK { + if e == rustix::io::Errno::AGAIN || e == rustix::io::Errno::WOULDBLOCK { break; } } @@ -402,7 +402,7 @@ impl<'a> Poller<'a> { impl NotifyToken { pub fn notify(self) -> io::Result { if let Err(e) = rustix::io::write(&*self.free, &[0]) { - if e == rustix::io::Error::AGAIN || e == rustix::io::Error::WOULDBLOCK { + if e == rustix::io::Errno::AGAIN || e == rustix::io::Errno::WOULDBLOCK { return Ok(self); }