feat(napi): impl Default for Buffer (#1734)
This commit is contained in:
parent
b19ada79fd
commit
2c410b238d
1 changed files with 6 additions and 0 deletions
|
@ -92,6 +92,12 @@ impl Clone for Buffer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Default for Buffer {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self::from(Vec::default())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl From<Vec<u8>> for Buffer {
|
impl From<Vec<u8>> for Buffer {
|
||||||
fn from(mut data: Vec<u8>) -> Self {
|
fn from(mut data: Vec<u8>) -> Self {
|
||||||
let inner_ptr = data.as_mut_ptr();
|
let inner_ptr = data.as_mut_ptr();
|
||||||
|
|
Loading…
Reference in a new issue