Skip to content

Commit acd1c60

Browse files
committed
Impl From<&Bufferfish> for Bytes via copy_from_slice
1 parent ef6d366 commit acd1c60

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

  • rust/bufferfish-core/src

rust/bufferfish-core/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -712,3 +712,9 @@ impl From<Bufferfish> for bytes::Bytes {
712712
bytes::Bytes::from(buffer.inner.into_inner())
713713
}
714714
}
715+
716+
impl From<&Bufferfish> for bytes::Bytes {
717+
fn from(buffer: &Bufferfish) -> Self {
718+
bytes::Bytes::copy_from_slice(buffer.as_ref())
719+
}
720+
}

0 commit comments

Comments
 (0)