From 33b1efe47bf877beaeae0e77ea82eb6bc46e4d92 Mon Sep 17 00:00:00 2001 From: wiedld Date: Tue, 31 Dec 2024 12:52:33 -0800 Subject: [PATCH] chore: provide trait in scope, within rust code example docs --- arrow-array/src/array/byte_array.rs | 2 +- arrow-array/src/builder/generic_byte_run_builder.rs | 6 +++--- arrow-array/src/builder/generic_bytes_builder.rs | 8 ++++---- arrow-array/src/builder/generic_bytes_view_builder.rs | 4 ++-- arrow-array/src/builder/generic_list_builder.rs | 2 +- arrow-array/src/builder/map_builder.rs | 2 +- arrow-array/src/builder/mod.rs | 10 +++++----- arrow-array/src/builder/struct_builder.rs | 2 +- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/arrow-array/src/array/byte_array.rs b/arrow-array/src/array/byte_array.rs index f2b22507081d..3db073eb00f0 100644 --- a/arrow-array/src/array/byte_array.rs +++ b/arrow-array/src/array/byte_array.rs @@ -69,7 +69,7 @@ use std::sync::Arc; /// /// ``` /// # use arrow_array::Array; -/// # use arrow_array::builder::GenericByteBuilder; +/// # use arrow_array::builder::{GenericByteBuilder, ValuesBuilder}; /// # use arrow_array::types::Utf8Type; /// let mut builder = GenericByteBuilder::::new(); /// builder.append_value("hello"); diff --git a/arrow-array/src/builder/generic_byte_run_builder.rs b/arrow-array/src/builder/generic_byte_run_builder.rs index 7c4583214673..358130dcead8 100644 --- a/arrow-array/src/builder/generic_byte_run_builder.rs +++ b/arrow-array/src/builder/generic_byte_run_builder.rs @@ -33,7 +33,7 @@ use arrow_buffer::ArrowNativeType; /// /// ``` /// -/// # use arrow_array::builder::GenericByteRunBuilder; +/// # use arrow_array::builder::{GenericByteRunBuilder, ValuesBuilder}; /// # use arrow_array::{GenericByteArray, BinaryArray}; /// # use arrow_array::types::{BinaryType, Int16Type}; /// # use arrow_array::{Array, Int16Array}; @@ -309,7 +309,7 @@ where /// // Create a run-end encoded array with run-end indexes data type as `i16`. /// // The encoded values are Strings. /// -/// # use arrow_array::builder::StringRunBuilder; +/// # use arrow_array::builder::{StringRunBuilder, ValuesBuilder}; /// # use arrow_array::{Int16Array, StringArray}; /// # use arrow_array::types::Int16Type; /// # use arrow_array::cast::AsArray; @@ -345,7 +345,7 @@ pub type LargeStringRunBuilder = GenericByteRunBuilder; /// // Create a run-end encoded array with run-end indexes data type as `i16`. /// // The encoded data is binary values. /// -/// # use arrow_array::builder::BinaryRunBuilder; +/// # use arrow_array::builder::{BinaryRunBuilder, ValuesBuilder}; /// # use arrow_array::{BinaryArray, Int16Array}; /// # use arrow_array::cast::AsArray; /// # use arrow_array::types::Int16Type; diff --git a/arrow-array/src/builder/generic_bytes_builder.rs b/arrow-array/src/builder/generic_bytes_builder.rs index 069ffb587d58..a090f8d25d63 100644 --- a/arrow-array/src/builder/generic_bytes_builder.rs +++ b/arrow-array/src/builder/generic_bytes_builder.rs @@ -255,7 +255,7 @@ impl> Extend> for GenericByteBui /// /// # Example writing strings with `append_value` /// ``` -/// # use arrow_array::builder::GenericStringBuilder; +/// # use arrow_array::builder::{GenericStringBuilder, ValuesBuilder}; /// let mut builder = GenericStringBuilder::::new(); /// /// // Write one string value @@ -273,7 +273,7 @@ impl> Extend> for GenericByteBui /// /// ``` /// # use std::fmt::Write; -/// # use arrow_array::builder::GenericStringBuilder; +/// # use arrow_array::builder::{GenericStringBuilder, ValuesBuilder}; /// let mut builder = GenericStringBuilder::::new(); /// /// // Write data in multiple `write!` calls @@ -308,7 +308,7 @@ impl std::fmt::Write for GenericStringBuilder { /// /// # Example /// ``` -/// # use arrow_array::builder::GenericBinaryBuilder; +/// # use arrow_array::builder::{GenericBinaryBuilder, ValuesBuilder}; /// let mut builder = GenericBinaryBuilder::::new(); /// /// // Write data @@ -327,7 +327,7 @@ impl std::fmt::Write for GenericStringBuilder { /// /// ``` /// # use std::io::Write; -/// # use arrow_array::builder::GenericBinaryBuilder; +/// # use arrow_array::builder::{GenericBinaryBuilder, ValuesBuilder}; /// let mut builder = GenericBinaryBuilder::::new(); /// /// // Write data in multiple `write_bytes` calls diff --git a/arrow-array/src/builder/generic_bytes_view_builder.rs b/arrow-array/src/builder/generic_bytes_view_builder.rs index 484428420f08..db8de3da5149 100644 --- a/arrow-array/src/builder/generic_bytes_view_builder.rs +++ b/arrow-array/src/builder/generic_bytes_view_builder.rs @@ -474,7 +474,7 @@ impl> Extend> /// /// # Example /// ``` -/// # use arrow_array::builder::StringViewBuilder; +/// # use arrow_array::builder::{StringViewBuilder, ValuesBuilder}; /// # use arrow_array::StringViewArray; /// let mut builder = StringViewBuilder::new(); /// builder.append_value("hello"); @@ -495,7 +495,7 @@ pub type StringViewBuilder = GenericByteViewBuilder; /// /// # Example /// ``` -/// # use arrow_array::builder::BinaryViewBuilder; +/// # use arrow_array::builder::{BinaryViewBuilder, ValuesBuilder}; /// use arrow_array::BinaryViewArray; /// let mut builder = BinaryViewBuilder::new(); /// builder.append_value("hello"); diff --git a/arrow-array/src/builder/generic_list_builder.rs b/arrow-array/src/builder/generic_list_builder.rs index a9c88ec6c586..c32624d46219 100644 --- a/arrow-array/src/builder/generic_list_builder.rs +++ b/arrow-array/src/builder/generic_list_builder.rs @@ -34,7 +34,7 @@ use std::sync::Arc; /// /// ``` /// # use std::sync::Arc; -/// # use arrow_array::{builder::ListBuilder, builder::StringBuilder, ArrayRef, StringArray, Array}; +/// # use arrow_array::{builder::{ListBuilder, StringBuilder, ValuesBuilder}, ArrayRef, StringArray, Array}; /// # /// let values_builder = StringBuilder::new(); /// let mut builder = ListBuilder::new(values_builder); diff --git a/arrow-array/src/builder/map_builder.rs b/arrow-array/src/builder/map_builder.rs index c11f3b230ce6..17f826c12ac1 100644 --- a/arrow-array/src/builder/map_builder.rs +++ b/arrow-array/src/builder/map_builder.rs @@ -27,7 +27,7 @@ use std::sync::Arc; /// Builder for [`MapArray`] /// /// ``` -/// # use arrow_array::builder::{Int32Builder, MapBuilder, StringBuilder}; +/// # use arrow_array::builder::{Int32Builder, MapBuilder, StringBuilder, ValuesBuilder}; /// # use arrow_array::{Int32Array, StringArray}; /// /// let string_builder = StringBuilder::new(); diff --git a/arrow-array/src/builder/mod.rs b/arrow-array/src/builder/mod.rs index 30445ae296e1..e25041d2c3c8 100644 --- a/arrow-array/src/builder/mod.rs +++ b/arrow-array/src/builder/mod.rs @@ -22,7 +22,7 @@ //! Builders can be used to build simple, non-nested arrays //! //! ``` -//! # use arrow_array::builder::Int32Builder; +//! # use arrow_array::builder::{Int32Builder, ValuesBuilder}; //! # use arrow_array::PrimitiveArray; //! let mut a = Int32Builder::new(); //! a.append_value(1); @@ -34,7 +34,7 @@ //! ``` //! //! ``` -//! # use arrow_array::builder::StringBuilder; +//! # use arrow_array::builder::{StringBuilder, ValuesBuilder}; //! # use arrow_array::{Array, StringArray}; //! let mut a = StringBuilder::new(); //! a.append_value("foo"); @@ -50,7 +50,7 @@ //! Builders can also be used to build more complex nested arrays, such as lists //! //! ``` -//! # use arrow_array::builder::{Int32Builder, ListBuilder}; +//! # use arrow_array::builder::{Int32Builder, ListBuilder, ValuesBuilder}; //! # use arrow_array::ListArray; //! # use arrow_array::types::Int32Type; //! let mut a = ListBuilder::new(Int32Builder::new()); @@ -87,7 +87,7 @@ //! //! ``` //! # use std::any::Any; -//! # use arrow_array::builder::{ArrayBuilder, Int32Builder, ListBuilder, StringBuilder}; +//! # use arrow_array::builder::{ArrayBuilder, Int32Builder, ListBuilder, StringBuilder, ValuesBuilder}; //! # use arrow_array::{ArrayRef, RecordBatch, StructArray}; //! # use arrow_schema::{DataType, Field}; //! # use std::sync::Arc; @@ -194,7 +194,7 @@ use std::any::Any; /// ``` /// // Create /// # use arrow_array::{ArrayRef, StringArray}; -/// # use arrow_array::builder::{ArrayBuilder, Float64Builder, Int64Builder, StringBuilder}; +/// # use arrow_array::builder::{ArrayBuilder, Float64Builder, Int64Builder, StringBuilder, ValuesBuilder}; /// /// let mut data_builders: Vec> = vec![ /// Box::new(Float64Builder::new()), diff --git a/arrow-array/src/builder/struct_builder.rs b/arrow-array/src/builder/struct_builder.rs index 2b288445c74b..0dfc3c0047c6 100644 --- a/arrow-array/src/builder/struct_builder.rs +++ b/arrow-array/src/builder/struct_builder.rs @@ -40,7 +40,7 @@ use std::sync::Arc; /// For a practical example see the code below: /// /// ```rust -/// use arrow_array::builder::{ArrayBuilder, ListBuilder, StringBuilder, StructBuilder}; +/// use arrow_array::builder::{ArrayBuilder, ListBuilder, StringBuilder, StructBuilder, ValuesBuilder}; /// use arrow_schema::{DataType, Field, Fields}; /// use std::sync::Arc; ///