style(napi): as ptr => ptr::cast (#1786)
This commit is contained in:
parent
1e5c32ca60
commit
65f57918fb
1 changed files with 2 additions and 2 deletions
|
@ -155,11 +155,11 @@ impl Env {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn create_string(&self, s: &str) -> Result<JsString> {
|
pub fn create_string(&self, s: &str) -> Result<JsString> {
|
||||||
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<JsString> {
|
pub fn create_string_from_std(&self, s: String) -> Result<JsString> {
|
||||||
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.
|
/// This API is used for C ffi scenario.
|
||||||
|
|
Loading…
Reference in a new issue