diff --git a/crates/napi/src/bindgen_runtime/js_values/buffer.rs b/crates/napi/src/bindgen_runtime/js_values/buffer.rs index 66fd324a..ebe3382c 100644 --- a/crates/napi/src/bindgen_runtime/js_values/buffer.rs +++ b/crates/napi/src/bindgen_runtime/js_values/buffer.rs @@ -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() } } diff --git a/crates/napi/src/js_values/arraybuffer.rs b/crates/napi/src/js_values/arraybuffer.rs index 76c654fd..da624536 100644 --- a/crates/napi/src/js_values/arraybuffer.rs +++ b/crates/napi/src/js_values/arraybuffer.rs @@ -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() } } diff --git a/crates/napi/src/js_values/buffer.rs b/crates/napi/src/js_values/buffer.rs index a0a7fcb2..1ce009de 100644 --- a/crates/napi/src/js_values/buffer.rs +++ b/crates/napi/src/js_values/buffer.rs @@ -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() } }