From 2c410b238d1ef15eee9fbe963b2fa754e803e8e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zg=C3=BCr=20Akkurt?= Date: Thu, 2 Nov 2023 17:32:13 +0300 Subject: [PATCH] feat(napi): impl Default for Buffer (#1734) --- crates/napi/src/bindgen_runtime/js_values/buffer.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/napi/src/bindgen_runtime/js_values/buffer.rs b/crates/napi/src/bindgen_runtime/js_values/buffer.rs index 4133bb80..4c6c73f0 100644 --- a/crates/napi/src/bindgen_runtime/js_values/buffer.rs +++ b/crates/napi/src/bindgen_runtime/js_values/buffer.rs @@ -92,6 +92,12 @@ impl Clone for Buffer { } } +impl Default for Buffer { + fn default() -> Self { + Self::from(Vec::default()) + } +} + impl From> for Buffer { fn from(mut data: Vec) -> Self { let inner_ptr = data.as_mut_ptr();