diff --git a/napi/src/js_values/arraybuffer.rs b/napi/src/js_values/arraybuffer.rs index 4a8dd8d4..cfd91a14 100644 --- a/napi/src/js_values/arraybuffer.rs +++ b/napi/src/js_values/arraybuffer.rs @@ -4,8 +4,7 @@ use std::os::raw::c_void; use std::ptr; use std::slice; -use super::{Value, ValueType}; -use crate::{check_status, sys, JsUnknown, NapiValue, Ref, Result}; +use crate::{check_status, sys, JsUnknown, NapiValue, Ref, Result, Value, ValueType}; pub struct JsArrayBuffer(pub(crate) Value); diff --git a/napi/src/js_values/string/mod.rs b/napi/src/js_values/string/mod.rs index 83715efa..d2a2c5f5 100644 --- a/napi/src/js_values/string/mod.rs +++ b/napi/src/js_values/string/mod.rs @@ -1,9 +1,7 @@ use std::mem; use std::ptr; -use super::Value; -use crate::check_status; -use crate::{sys, Ref, Result}; +use crate::{check_status, sys, Result, Value}; pub use latin1::JsStringLatin1; pub use utf16::JsStringUtf16; @@ -13,7 +11,6 @@ mod latin1; mod utf16; mod utf8; -#[derive(Clone, Copy)] pub struct JsString(pub(crate) Value); impl JsString { @@ -70,11 +67,6 @@ impl JsString { }) } - #[inline] - pub fn into_utf8_ref(self) -> Result> { - Ref::new(self.0, 1, self.into_utf8()?) - } - #[inline] pub fn into_utf16(self) -> Result { let mut written_char_count = 0usize; @@ -100,11 +92,6 @@ impl JsString { }) } - #[inline] - pub fn into_utf16_ref(self) -> Result> { - Ref::new(self.0, 1, self.into_utf16()?) - } - #[inline] pub fn into_latin1(self) -> Result { let mut written_char_count = 0usize; @@ -130,9 +117,4 @@ impl JsString { }), }) } - - #[inline] - pub fn into_latin1_ref(self) -> Result> { - Ref::new(self.0, 1, self.into_latin1()?) - } }