From e39e017023fee4c9a4534bbcdc8e80f1ac312bd8 Mon Sep 17 00:00:00 2001 From: Steve Lau Date: Sun, 2 Jun 2024 18:26:50 +0800 Subject: [PATCH] chore: ignore lint unsafe_op_in_unsafe_fn for usage of env::remove_var --- src/env.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/env.rs b/src/env.rs index 510bbb0924..232797a68c 100644 --- a/src/env.rs +++ b/src/env.rs @@ -49,6 +49,8 @@ pub unsafe fn clearenv() -> std::result::Result<(), ClearEnvError> { } else { use std::env; for (name, _) in env::vars_os() { + // Ignore the lint due to Rust bug: https://github.com/rust-lang/rust/issues/125875 + #[allow(unsafe_op_in_unsafe_fn)] env::remove_var(name); } let ret = 0;