From 15535457ff8c7de5a27dde5624b96313cb281d5d Mon Sep 17 00:00:00 2001 From: Matthijs Brobbel Date: Mon, 11 Dec 2023 18:21:40 +0100 Subject: [PATCH] impl `From>` for `ScalarBuffer` (#5203) --- arrow-buffer/src/buffer/scalar.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arrow-buffer/src/buffer/scalar.rs b/arrow-buffer/src/buffer/scalar.rs index 3b75d5384046..ca1a1d230b12 100644 --- a/arrow-buffer/src/buffer/scalar.rs +++ b/arrow-buffer/src/buffer/scalar.rs @@ -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; @@ -145,6 +145,12 @@ impl From for ScalarBuffer { } } +impl From> for ScalarBuffer { + fn from(value: OffsetBuffer) -> Self { + value.into_inner() + } +} + impl From> for ScalarBuffer { fn from(value: Vec) -> Self { Self {