Skip to content

Commit 889a904

Browse files
authored
impl From<ScalarBuffer<T>> for Buffer (#6389)
1 parent f80bc5f commit 889a904

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

arrow-buffer/src/buffer/immutable.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use crate::BufferBuilder;
2626
use crate::{bytes::Bytes, native::ArrowNativeType};
2727

2828
use super::ops::bitwise_unary_op_helper;
29-
use super::MutableBuffer;
29+
use super::{MutableBuffer, ScalarBuffer};
3030

3131
/// Buffer represents a contiguous memory region that can be shared with other buffers and across
3232
/// thread boundaries.
@@ -391,6 +391,12 @@ impl<T: ArrowNativeType> From<Vec<T>> for Buffer {
391391
}
392392
}
393393

394+
impl<T: ArrowNativeType> From<ScalarBuffer<T>> for Buffer {
395+
fn from(value: ScalarBuffer<T>) -> Self {
396+
value.into_inner()
397+
}
398+
}
399+
394400
/// Creating a `Buffer` instance by storing the boolean values into the buffer
395401
impl FromIterator<bool> for Buffer {
396402
fn from_iter<I>(iter: I) -> Self

0 commit comments

Comments
 (0)