Skip to content

Commit e7e8abc

Browse files
committed
clippy cleanup with the latest nightly
1 parent d9b69f9 commit e7e8abc

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/env.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ impl std::error::Error for ClearEnvError {}
3939
/// environment access in the program is via `std::env`, but the requirement on
4040
/// thread safety must still be upheld.
4141
pub unsafe fn clearenv() -> std::result::Result<(), ClearEnvError> {
42-
let ret;
4342
cfg_if! {
4443
if #[cfg(any(target_os = "fuchsia",
4544
target_os = "wasi",
@@ -48,13 +47,13 @@ pub unsafe fn clearenv() -> std::result::Result<(), ClearEnvError> {
4847
target_os = "linux",
4948
target_os = "android",
5049
target_os = "emscripten"))] {
51-
ret = libc::clearenv();
50+
let ret = libc::clearenv();
5251
} else {
5352
use std::env;
5453
for (name, _) in env::vars_os() {
5554
env::remove_var(name);
5655
}
57-
ret = 0;
56+
let ret = 0;
5857
}
5958
}
6059

test/test_unistd.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ fn test_mkfifoat_directory_none() {
154154
let _m = crate::CWD_LOCK.read();
155155

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

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

171-
assert!(!mkfifoat(Some(dirfd), mkfifoat_dir, Mode::S_IRUSR).is_ok());
171+
assert!(mkfifoat(Some(dirfd), mkfifoat_dir, Mode::S_IRUSR).is_err());
172172
}
173173

174174
#[test]

0 commit comments

Comments
 (0)