diff options
Diffstat (limited to 'test/test_fcntl.rs')
-rw-r--r-- | test/test_fcntl.rs | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/test/test_fcntl.rs b/test/test_fcntl.rs index d1c70856..18b73481 100644 --- a/test/test_fcntl.rs +++ b/test/test_fcntl.rs @@ -1,6 +1,4 @@ #[cfg(not(target_os = "redox"))] -use nix::Error; -#[cfg(not(target_os = "redox"))] use nix::errno::*; #[cfg(not(target_os = "redox"))] use nix::fcntl::{open, OFlag, readlink}; @@ -55,7 +53,7 @@ fn test_renameat() { let new_dirfd = open(new_dir.path(), OFlag::empty(), Mode::empty()).unwrap(); renameat(Some(old_dirfd), "old", Some(new_dirfd), "new").unwrap(); assert_eq!(renameat(Some(old_dirfd), "old", Some(new_dirfd), "new").unwrap_err(), - Error::Sys(Errno::ENOENT)); + Errno::ENOENT); close(old_dirfd).unwrap(); close(new_dirfd).unwrap(); assert!(new_dir.path().join("new").exists()); @@ -385,7 +383,7 @@ mod test_posix_fallocate { assert_eq!(tmp.read(&mut data).expect("read failure"), LEN); assert_eq!(&data[..], &[0u8; LEN][..]); } - Err(nix::Error::Sys(Errno::EINVAL)) => { + Err(Errno::EINVAL) => { // POSIX requires posix_fallocate to return EINVAL both for // invalid arguments (i.e. len < 0) and if the operation is not // supported by the file system. @@ -401,12 +399,8 @@ mod test_posix_fallocate { fn errno() { let (rd, _wr) = pipe().unwrap(); let err = posix_fallocate(rd as RawFd, 0, 100).unwrap_err(); - use nix::Error::Sys; match err { - Sys(Errno::EINVAL) - | Sys(Errno::ENODEV) - | Sys(Errno::ESPIPE) - | Sys(Errno::EBADF) => (), + Errno::EINVAL | Errno::ENODEV | Errno::ESPIPE | Errno::EBADF => (), errno => panic!( "unexpected errno {}", |