diff options
Diffstat (limited to 'src/util.rs')
| -rw-r--r-- | src/util.rs | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/src/util.rs b/src/util.rs index dba954b..7263738 100644 --- a/src/util.rs +++ b/src/util.rs @@ -3,7 +3,7 @@ use std::{ os::unix::io::{IntoRawFd, RawFd}, }; -use nix::{self, errno::Errno, unistd::close}; +use nix::unistd::close; use quick_error::quick_error; quick_error! { @@ -79,18 +79,6 @@ impl<'a> Iterator for OutputChainIter<'a> { } } -pub fn from_nix_error(error: nix::Error) -> std::io::Error { - use nix::Error::*; - let from_raw = |code| std::io::Error::from_raw_os_error(code as i32); - - match error { - Sys(errno) => errno.into(), - InvalidPath => from_raw(Errno::ENAMETOOLONG), - InvalidUtf8 => from_raw(Errno::EILSEQ), - UnsupportedOperation => from_raw(Errno::EOPNOTSUPP), - } -} - pub fn display_or<'a, T: fmt::Display + 'a>( maybe: Option<T>, default: &'a str, |
