From 889a90436ffd69e94975049b047c413c53b2dfe3 Mon Sep 17 00:00:00 2001 From: Matthijs Brobbel Date: Fri, 13 Sep 2024 11:23:25 +0200 Subject: [PATCH] impl `From>` for `Buffer` (#6389) --- arrow-buffer/src/buffer/immutable.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arrow-buffer/src/buffer/immutable.rs b/arrow-buffer/src/buffer/immutable.rs index fef2f8008b2a..8d1a46583fca 100644 --- a/arrow-buffer/src/buffer/immutable.rs +++ b/arrow-buffer/src/buffer/immutable.rs @@ -26,7 +26,7 @@ use crate::BufferBuilder; use crate::{bytes::Bytes, native::ArrowNativeType}; use super::ops::bitwise_unary_op_helper; -use super::MutableBuffer; +use super::{MutableBuffer, ScalarBuffer}; /// Buffer represents a contiguous memory region that can be shared with other buffers and across /// thread boundaries. @@ -391,6 +391,12 @@ impl From> for Buffer { } } +impl From> for Buffer { + fn from(value: ScalarBuffer) -> Self { + value.into_inner() + } +} + /// Creating a `Buffer` instance by storing the boolean values into the buffer impl FromIterator for Buffer { fn from_iter(iter: I) -> Self