summaryrefslogtreecommitdiff
path: root/src/env.rs
diff options
context:
space:
mode:
authorAlan Somers <asomers@gmail.com>2021-12-11 16:55:15 -0700
committerAlan Somers <asomers@gmail.com>2021-12-11 16:55:15 -0700
commite7e8abc506218d7772b610e9ba8ae29eed35314e (patch)
tree4fde4b5ded211e8bce919f0d7550f5b7aa897956 /src/env.rs
parentd9b69f9c6d8d2a47980d2dd9a9654e0b4f06b799 (diff)
downloadnix-e7e8abc506218d7772b610e9ba8ae29eed35314e.zip
clippy cleanup with the latest nightly
Diffstat (limited to 'src/env.rs')
-rw-r--r--src/env.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/env.rs b/src/env.rs
index 54d75959..bcae2871 100644
--- a/src/env.rs
+++ b/src/env.rs
@@ -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",
@@ -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;
}
}