From 65f57918fb2c5bce312544a0871b8189bab57a0a Mon Sep 17 00:00:00 2001 From: LongYinan Date: Mon, 6 Nov 2023 11:22:30 +0800 Subject: [PATCH] style(napi): as ptr => ptr::cast (#1786) --- crates/napi/src/env.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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.