Skip to content

Commit

Permalink
impl From<OffsetBuffer<T>> for ScalarBuffer<T> (#5203)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrobbel authored Dec 11, 2023
1 parent 9630aaf commit 1553545
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion arrow-buffer/src/buffer/scalar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use crate::alloc::Deallocation;
use crate::buffer::Buffer;
use crate::native::ArrowNativeType;
use crate::MutableBuffer;
use crate::{MutableBuffer, OffsetBuffer};
use std::fmt::Formatter;
use std::marker::PhantomData;
use std::ops::Deref;
Expand Down Expand Up @@ -145,6 +145,12 @@ impl<T: ArrowNativeType> From<Buffer> for ScalarBuffer<T> {
}
}

impl<T: ArrowNativeType> From<OffsetBuffer<T>> for ScalarBuffer<T> {
fn from(value: OffsetBuffer<T>) -> Self {
value.into_inner()
}
}

impl<T: ArrowNativeType> From<Vec<T>> for ScalarBuffer<T> {
fn from(value: Vec<T>) -> Self {
Self {
Expand Down

0 comments on commit 1553545

Please sign in to comment.