Skip to content

Commit

Permalink
Merge #1605
Browse files Browse the repository at this point in the history
1605: clippy cleanup with the latest nightly r=rtzoeller a=asomers



Co-authored-by: Alan Somers <asomers@gmail.com>
  • Loading branch information
bors[bot] and asomers committed Dec 12, 2021
2 parents d9b69f9 + e7e8abc commit 2b27e2a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ impl std::error::Error for ClearEnvError {}
/// environment access in the program is via `std::env`, but the requirement on
/// thread safety must still be upheld.
pub unsafe fn clearenv() -> std::result::Result<(), ClearEnvError> {
let ret;
cfg_if! {
if #[cfg(any(target_os = "fuchsia",
target_os = "wasi",
Expand All @@ -48,13 +47,13 @@ pub unsafe fn clearenv() -> std::result::Result<(), ClearEnvError> {
target_os = "linux",
target_os = "android",
target_os = "emscripten"))] {
ret = libc::clearenv();
let ret = libc::clearenv();
} else {
use std::env;
for (name, _) in env::vars_os() {
env::remove_var(name);
}
ret = 0;
let ret = 0;
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/test_unistd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ fn test_mkfifoat_directory_none() {
let _m = crate::CWD_LOCK.read();

// mkfifoat should fail if a directory is given
assert!(!mkfifoat(None, &env::temp_dir(), Mode::S_IRUSR).is_ok());
assert!(mkfifoat(None, &env::temp_dir(), Mode::S_IRUSR).is_err());
}

#[test]
Expand All @@ -168,7 +168,7 @@ fn test_mkfifoat_directory() {
let mkfifoat_dir = "mkfifoat_dir";
stat::mkdirat(dirfd, mkfifoat_dir, Mode::S_IRUSR).unwrap();

assert!(!mkfifoat(Some(dirfd), mkfifoat_dir, Mode::S_IRUSR).is_ok());
assert!(mkfifoat(Some(dirfd), mkfifoat_dir, Mode::S_IRUSR).is_err());
}

#[test]
Expand Down

0 comments on commit 2b27e2a

Please sign in to comment.