From ff5701498968fcead25de9ec488da0479c460222 Mon Sep 17 00:00:00 2001 From: Kyle Barron Date: Mon, 30 Dec 2024 06:06:37 -0800 Subject: [PATCH 1/3] Add doctest example for --- arrow-buffer/src/buffer/immutable.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arrow-buffer/src/buffer/immutable.rs b/arrow-buffer/src/buffer/immutable.rs index d0c8ffa39783..a81c2ad439e4 100644 --- a/arrow-buffer/src/buffer/immutable.rs +++ b/arrow-buffer/src/buffer/immutable.rs @@ -60,6 +60,15 @@ unsafe impl Sync for Buffer where Bytes: Sync {} impl Buffer { /// Auxiliary method to create a new Buffer + /// + /// This can be used with a `bytes::Bytes` via `into()`: + /// + /// ``` + /// # use arrow_buffer::Buffer; + /// let bytes = bytes::Bytes::from_static(b"foo"); + /// let buffer = Buffer::from_bytes(bytes.into()); + /// ``` + /// Though the Arrow bytes type is not public, #[inline] pub fn from_bytes(bytes: Bytes) -> Self { let length = bytes.len(); From 221843cdedf6a48e9fd9270855580af8c42c769d Mon Sep 17 00:00:00 2001 From: Kyle Barron Date: Mon, 30 Dec 2024 06:14:21 -0800 Subject: [PATCH 2/3] Remove typo --- arrow-buffer/src/buffer/immutable.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/arrow-buffer/src/buffer/immutable.rs b/arrow-buffer/src/buffer/immutable.rs index a81c2ad439e4..adac5355c0e3 100644 --- a/arrow-buffer/src/buffer/immutable.rs +++ b/arrow-buffer/src/buffer/immutable.rs @@ -68,7 +68,6 @@ impl Buffer { /// let bytes = bytes::Bytes::from_static(b"foo"); /// let buffer = Buffer::from_bytes(bytes.into()); /// ``` - /// Though the Arrow bytes type is not public, #[inline] pub fn from_bytes(bytes: Bytes) -> Self { let length = bytes.len(); From 69819e2dd22fa87618ebb48b2a6368e1e4af734b Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Wed, 1 Jan 2025 09:15:33 -0500 Subject: [PATCH 3/3] Update arrow-buffer/src/buffer/immutable.rs --- arrow-buffer/src/buffer/immutable.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arrow-buffer/src/buffer/immutable.rs b/arrow-buffer/src/buffer/immutable.rs index adac5355c0e3..cf1d6f366751 100644 --- a/arrow-buffer/src/buffer/immutable.rs +++ b/arrow-buffer/src/buffer/immutable.rs @@ -61,7 +61,7 @@ unsafe impl Sync for Buffer where Bytes: Sync {} impl Buffer { /// Auxiliary method to create a new Buffer /// - /// This can be used with a `bytes::Bytes` via `into()`: + /// This can be used with a [`bytes::Bytes`] via `into()`: /// /// ``` /// # use arrow_buffer::Buffer;