diff --git a/crates/napi/src/env.rs b/crates/napi/src/env.rs index 754d1744..bbb1bb36 100644 --- a/crates/napi/src/env.rs +++ b/crates/napi/src/env.rs @@ -155,11 +155,11 @@ impl Env { } pub fn create_string(&self, s: &str) -> Result { - unsafe { self.create_string_from_c_char(s.as_ptr() as *const c_char, s.len()) } + unsafe { self.create_string_from_c_char(s.as_ptr().cast(), s.len()) } } pub fn create_string_from_std(&self, s: String) -> Result { - unsafe { self.create_string_from_c_char(s.as_ptr() as *const c_char, s.len()) } + unsafe { self.create_string_from_c_char(s.as_ptr().cast(), s.len()) } } /// This API is used for C ffi scenario.