Skip to content

Commit

Permalink
Bump nix version to 0.23.0
Browse files Browse the repository at this point in the history
Notable changes:

- The nix Error enum is just a direct errno now (not an enum anymore) so
  we can just handle it directly without matching on it
  • Loading branch information
glittershark committed Oct 8, 2021
1 parent 4ce208d commit eeed070
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,4 @@ named_pipe = "~0.4"

[target.'cfg(unix)'.dependencies]
libc = "0.2"
nix = "0.21.0"

nix = "0.23.0"
7 changes: 2 additions & 5 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,8 @@ impl From<std::convert::Infallible> for Error {

#[cfg(unix)]
impl From<::nix::Error> for Error {
fn from(x: ::nix::Error) -> Error {
match x {
::nix::Error::Sys(errno) => Error::from(io::Error::from_raw_os_error(errno as i32)),
_ => Error::from(io::Error::new(io::ErrorKind::Other, x)),
}
fn from(errno: ::nix::Error) -> Error {
Error::from(io::Error::from_raw_os_error(errno as i32))
}
}

Expand Down

0 comments on commit eeed070

Please sign in to comment.