feat(napi): refine return type

This commit is contained in:
liulinboyi 2021-12-18 11:52:49 +08:00
parent 01b5a6dc3f
commit 486765b35e
3 changed files with 3 additions and 3 deletions

View file

@ -37,7 +37,7 @@ impl AsMut<[u8]> for Buffer {
impl Deref for Buffer {
type Target = [u8];
fn deref(&self) -> &[u8] {
fn deref(&self) -> &Self::Target {
self.inner.as_slice()
}
}

View file

@ -216,7 +216,7 @@ impl AsMut<[u8]> for JsArrayBufferValue {
impl Deref for JsArrayBufferValue {
type Target = [u8];
fn deref(&self) -> &[u8] {
fn deref(&self) -> &Self::Target {
self.as_ref()
}
}

View file

@ -86,7 +86,7 @@ impl AsMut<[u8]> for JsBufferValue {
impl Deref for JsBufferValue {
type Target = [u8];
fn deref(&self) -> &[u8] {
fn deref(&self) -> &Self::Target {
self.data.as_slice()
}
}