Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions arrow-buffer/src/buffer/immutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,12 @@ impl From<&[u8]> for Buffer {
}
}

impl AsRef<[u8]> for &Buffer {
fn as_ref(&self) -> &[u8] {
self.as_slice()
}
}

impl<const N: usize> From<[u8; N]> for Buffer {
fn from(p: [u8; N]) -> Self {
Self::from_slice_ref(p)
Expand Down
1 change: 0 additions & 1 deletion arrow-buffer/src/buffer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ pub use mutable::*;
mod ops;
pub use ops::*;
mod mutable_ops;
pub use mutable_ops::*;
mod scalar;
pub use scalar::*;
mod boolean;
Expand Down
6 changes: 6 additions & 0 deletions arrow-buffer/src/buffer/mutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,12 @@ impl MutableBuffer {
}
}

impl AsRef<[u8]> for &MutableBuffer {
fn as_ref(&self) -> &[u8] {
self.as_slice()
}
}

impl Default for MutableBuffer {
fn default() -> Self {
Self::with_capacity(0)
Expand Down
Loading