From 86c6edc2c011b0a205e99bcdca463eb218f935c5 Mon Sep 17 00:00:00 2001 From: Grzegorz Placzek Date: Tue, 12 Sep 2023 09:59:17 +0200 Subject: [PATCH] [#48828] Remove redundant casts --- src/lib.rs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 9ad29b9..a0b4492 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -190,16 +190,9 @@ pub fn set_env(key: &str, val: Option<&str>) -> Result<(), ExitCode> { let c_key = CString::new(key).unwrap(); match if let Some(v) = val { let c_val = CString::new(v).unwrap(); - unsafe { - wasi_ext_lib_generated::wasi_ext_set_env( - c_key.as_ptr() as *const i8, - c_val.as_ptr() as *const i8, - ) - } + unsafe { wasi_ext_lib_generated::wasi_ext_set_env(c_key.as_ptr(), c_val.as_ptr()) } } else { - unsafe { - wasi_ext_lib_generated::wasi_ext_set_env(c_key.as_ptr() as *const i8, ptr::null::()) - } + unsafe { wasi_ext_lib_generated::wasi_ext_set_env(c_key.as_ptr(), ptr::null::()) } } { 0 => Ok(()), e => Err(e),