Skip to content

Commit 0111ae6

Browse files
committed
use From<Bytes> instead
1 parent dc5639e commit 0111ae6

2 files changed

Lines changed: 1 addition & 16 deletions

File tree

arrow-buffer/src/buffer/immutable.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -105,21 +105,6 @@ impl Buffer {
105105
Self::from(bytes)
106106
}
107107

108-
/// Auxiliary method to create a new Buffer
109-
///
110-
/// This is convenient for converting a [`bytes::Bytes`] to a [`Buffer`] without copying.
111-
///
112-
/// ```
113-
/// # use arrow_buffer::Buffer;
114-
/// let bytes = bytes::Bytes::from_static(b"foo");
115-
/// let buffer = Buffer::from_external_bytes(bytes);
116-
/// ```
117-
#[inline]
118-
pub fn from_external_bytes(bytes: bytes::Bytes) -> Self {
119-
let inner_bytes = Bytes::from(bytes);
120-
Self::from_bytes(inner_bytes)
121-
}
122-
123108
/// Returns the offset, in bytes, of `Self::ptr` to `Self::data`
124109
///
125110
/// self.ptr and self.data can be different after slicing or advancing the buffer.

parquet/src/arrow/array_reader/byte_view_array.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ impl ByteViewArrayDecoderPlain {
308308
validate_utf8: bool,
309309
) -> Self {
310310
Self {
311-
buf: Buffer::from_external_bytes(buf),
311+
buf: Buffer::from(buf),
312312
offset: 0,
313313
max_remaining_values: num_values.unwrap_or(num_levels),
314314
validate_utf8,

0 commit comments

Comments
 (0)