From 2b51554ff59d1e5cbf8dd2db65d278b0202a9102 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 27 Jun 2026 03:52:05 +0900 Subject: refactor: fix compiler warnings and clippy warnings --- crates/shirabe-php-shim/src/env.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'crates/shirabe-php-shim/src/env.rs') diff --git a/crates/shirabe-php-shim/src/env.rs b/crates/shirabe-php-shim/src/env.rs index cf0c659..9043167 100644 --- a/crates/shirabe-php-shim/src/env.rs +++ b/crates/shirabe-php-shim/src/env.rs @@ -8,11 +8,21 @@ pub fn getenv>(key: K) -> Option { std::env::var_os(key) } +/// # Safety +/// +/// Wraps [`std::env::set_var`], which is unsafe: the caller must ensure no other +/// thread is concurrently reading or writing the process environment for the +/// duration of this call. pub unsafe fn putenv, V: AsRef>(key: K, value: V) { // TODO: validate key and value format to avoid panic? unsafe { std::env::set_var(key, value) } } +/// # Safety +/// +/// Wraps [`std::env::remove_var`], which is unsafe: the caller must ensure no other +/// thread is concurrently reading or writing the process environment for the +/// duration of this call. pub unsafe fn putenv_clear>(key: K) { // TODO: validate key and value format to avoid panic? unsafe { std::env::remove_var(key) } -- cgit v1.3.1