Skip to content

Commit

Permalink
chore: provide trait in scope, within rust code example docs
Browse files Browse the repository at this point in the history
  • Loading branch information
wiedld committed Dec 31, 2024
1 parent ae9820f commit 33b1efe
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion arrow-array/src/array/byte_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<Utf8Type>::new();
/// builder.append_value("hello");
Expand Down
6 changes: 3 additions & 3 deletions arrow-array/src/builder/generic_byte_run_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -345,7 +345,7 @@ pub type LargeStringRunBuilder<K> = GenericByteRunBuilder<K, LargeUtf8Type>;
/// // 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;
Expand Down
8 changes: 4 additions & 4 deletions arrow-array/src/builder/generic_bytes_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ impl<T: ByteArrayType, V: AsRef<T::Native>> Extend<Option<V>> for GenericByteBui
///
/// # Example writing strings with `append_value`
/// ```
/// # use arrow_array::builder::GenericStringBuilder;
/// # use arrow_array::builder::{GenericStringBuilder, ValuesBuilder};
/// let mut builder = GenericStringBuilder::<i32>::new();
///
/// // Write one string value
Expand All @@ -273,7 +273,7 @@ impl<T: ByteArrayType, V: AsRef<T::Native>> Extend<Option<V>> for GenericByteBui
///
/// ```
/// # use std::fmt::Write;
/// # use arrow_array::builder::GenericStringBuilder;
/// # use arrow_array::builder::{GenericStringBuilder, ValuesBuilder};
/// let mut builder = GenericStringBuilder::<i32>::new();
///
/// // Write data in multiple `write!` calls
Expand Down Expand Up @@ -308,7 +308,7 @@ impl<O: OffsetSizeTrait> std::fmt::Write for GenericStringBuilder<O> {
///
/// # Example
/// ```
/// # use arrow_array::builder::GenericBinaryBuilder;
/// # use arrow_array::builder::{GenericBinaryBuilder, ValuesBuilder};
/// let mut builder = GenericBinaryBuilder::<i32>::new();
///
/// // Write data
Expand All @@ -327,7 +327,7 @@ impl<O: OffsetSizeTrait> std::fmt::Write for GenericStringBuilder<O> {
///
/// ```
/// # use std::io::Write;
/// # use arrow_array::builder::GenericBinaryBuilder;
/// # use arrow_array::builder::{GenericBinaryBuilder, ValuesBuilder};
/// let mut builder = GenericBinaryBuilder::<i32>::new();
///
/// // Write data in multiple `write_bytes` calls
Expand Down
4 changes: 2 additions & 2 deletions arrow-array/src/builder/generic_bytes_view_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ impl<T: ByteViewType + ?Sized, V: AsRef<T::Native>> Extend<Option<V>>
///
/// # 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");
Expand All @@ -495,7 +495,7 @@ pub type StringViewBuilder = GenericByteViewBuilder<StringViewType>;
///
/// # 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");
Expand Down
2 changes: 1 addition & 1 deletion arrow-array/src/builder/generic_list_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion arrow-array/src/builder/map_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
10 changes: 5 additions & 5 deletions arrow-array/src/builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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");
Expand All @@ -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());
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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<Box<dyn ArrayBuilder>> = vec![
/// Box::new(Float64Builder::new()),
Expand Down
2 changes: 1 addition & 1 deletion arrow-array/src/builder/struct_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
///
Expand Down

0 comments on commit 33b1efe

Please sign in to comment.