diff --git a/crates/store/re_types_core/src/arrow_buffer.rs b/crates/store/re_types_core/src/arrow_buffer.rs index f78831bccdb9a..456969393a75c 100644 --- a/crates/store/re_types_core/src/arrow_buffer.rs +++ b/crates/store/re_types_core/src/arrow_buffer.rs @@ -3,7 +3,7 @@ use arrow2::buffer::Buffer; /// Convenience-wrapper around an arrow [`Buffer`] that is known to contain a /// a primitive type. /// -/// The arrow2 [`Buffer`] object is internally reference-counted and can be +/// The [`ArrowBuffer`] object is internally reference-counted and can be /// easily converted back to a `&[T]` referencing the underlying storage. /// This avoids some of the lifetime complexities that would otherwise /// arise from returning a `&[T]` directly, but is significantly more @@ -50,7 +50,7 @@ impl ArrowBuffer { self.0.as_slice() } - /// Returns a new [`Buffer`] that is a slice of this buffer starting at `offset`. + /// Returns a new [`ArrowBuffer`] that is a slice of this buffer starting at `offset`. /// /// Doing so allows the same memory region to be shared between buffers. /// @@ -95,9 +95,18 @@ impl ArrowBuffer { } } -impl From> for ArrowBuffer { +impl + From> for ArrowBuffer +{ #[inline] - fn from(value: Buffer) -> Self { + fn from(value: arrow::buffer::ScalarBuffer) -> Self { + Self(value.into_inner().into()) + } +} + +impl From> for ArrowBuffer { + #[inline] + fn from(value: arrow2::buffer::Buffer) -> Self { Self(value) } } @@ -118,7 +127,7 @@ impl From<&[T]> for ArrowBuffer { impl FromIterator for ArrowBuffer { fn from_iter>(iter: I) -> Self { - Self(Buffer::from_iter(iter)) + Self(arrow2::buffer::Buffer::from_iter(iter)) } }