Skip to content

Commit ffef105

Browse files
committed
fix doc tests
Signed-off-by: Connor Tsui <[email protected]>
1 parent afc8184 commit ffef105

File tree

10 files changed

+73
-44
lines changed

10 files changed

+73
-44
lines changed

vortex-vector/src/binaryview/vector_mut.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ impl<T: BinaryViewType> BinaryViewVectorMut<T> {
115115
/// Append a repeated sequence of binary data to a vector.
116116
///
117117
/// ```
118-
/// # use vortex_vector::{StringVectorMut, VectorMutOps};
118+
/// # use vortex_vector::binaryview::StringVectorMut;
119+
/// # use vortex_vector::VectorMutOps;
119120
/// let mut strings = StringVectorMut::with_capacity(4);
120121
/// strings.append_values("inlined", 2);
121122
/// strings.append_nulls(1);

vortex-vector/src/bool/iter.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ impl FromIterator<Option<bool>> for BoolVectorMut {
1717
/// # Examples
1818
///
1919
/// ```
20-
/// use vortex_vector::{BoolVectorMut, VectorMutOps};
20+
/// use vortex_vector::bool::BoolVectorMut;
21+
/// use vortex_vector::VectorMutOps;
2122
///
2223
/// let mut vec = BoolVectorMut::from_iter([Some(true), None, Some(false)]);
2324
/// assert_eq!(vec.len(), 3);
@@ -61,7 +62,8 @@ impl FromIterator<bool> for BoolVectorMut {
6162
/// # Examples
6263
///
6364
/// ```
64-
/// use vortex_vector::{BoolVectorMut, VectorMutOps};
65+
/// use vortex_vector::bool::BoolVectorMut;
66+
/// use vortex_vector::VectorMutOps;
6567
///
6668
/// let mut vec = BoolVectorMut::from_iter([true, false, false, true]);
6769
/// assert_eq!(vec.len(), 4);
@@ -127,7 +129,7 @@ impl IntoIterator for BoolVectorMut {
127129
/// # Examples
128130
///
129131
/// ```
130-
/// use vortex_vector::BoolVectorMut;
132+
/// use vortex_vector::bool::BoolVectorMut;
131133
///
132134
/// let vec = BoolVectorMut::from_iter([Some(true), None, Some(false), Some(true)]);
133135
/// let collected: Vec<_> = vec.into_iter().collect();

vortex-vector/src/bool/mod.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
//! ## Extending and appending
99
//!
1010
//! ```
11-
//! use vortex_vector::{BoolVectorMut, VectorMutOps};
11+
//! use vortex_vector::bool::BoolVectorMut;
12+
//! use vortex_vector::VectorMutOps;
1213
//!
1314
//! let mut vec1 = BoolVectorMut::from_iter([true, false].map(Some));
1415
//! let vec2 = BoolVectorMut::from_iter([true, true].map(Some)).freeze();
@@ -25,7 +26,8 @@
2526
//! ## Splitting and unsplitting
2627
//!
2728
//! ```
28-
//! use vortex_vector::{BoolVectorMut, VectorMutOps};
29+
//! use vortex_vector::bool::BoolVectorMut;
30+
//! use vortex_vector::VectorMutOps;
2931
//!
3032
//! let mut vec = BoolVectorMut::from_iter([true, false, true, false, true].map(Some));
3133
//!
@@ -42,7 +44,8 @@
4244
//! ## Converting to immutable
4345
//!
4446
//! ```
45-
//! use vortex_vector::{BoolVectorMut, VectorMutOps, VectorOps};
47+
//! use vortex_vector::bool::BoolVectorMut;
48+
//! use vortex_vector::{VectorMutOps, VectorOps};
4649
//!
4750
//! let mut vec = BoolVectorMut::from_iter([true, false, true].map(Some));
4851
//!

vortex-vector/src/decimal/mod.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
//!
1717
//! ```
1818
//! use vortex_dtype::{DecimalDType, PrecisionScale};
19-
//! use vortex_vector::{DVectorMut, VectorMutOps};
19+
//! use vortex_vector::decimal::{DVectorMut};
20+
//! use vortex_vector::VectorMutOps;
2021
//!
2122
//! // Create a decimal vector with precision=9, scale=2 (e.g., up to 9999999.99).
2223
//! let decimal_dtype = DecimalDType::new(9, 2);
@@ -50,7 +51,8 @@
5051
//! use vortex_buffer::BufferMut;
5152
//! use vortex_dtype::{DecimalDType, PrecisionScale};
5253
//! use vortex_mask::MaskMut;
53-
//! use vortex_vector::{DVectorMut, VectorMutOps};
54+
//! use vortex_vector::decimal::DVectorMut;
55+
//! use vortex_vector::VectorMutOps;
5456
//!
5557
//! // Create a decimal vector with nulls.
5658
//! let decimal_dtype = DecimalDType::new(5, 2); // Up to 999.99.
@@ -79,7 +81,8 @@
7981
//!
8082
//! ```
8183
//! use vortex_dtype::DecimalDType;
82-
//! use vortex_vector::{DVectorMut, VectorMutOps};
84+
//! use vortex_vector::decimal::DVectorMut;
85+
//! use vortex_vector::VectorMutOps;
8386
//!
8487
//! // Create two decimal vectors with scale=3 (3 decimal places).
8588
//! let decimal_dtype = DecimalDType::new(10, 3);
@@ -114,7 +117,8 @@
114117
//!
115118
//! ```
116119
//! use vortex_dtype::DecimalDType;
117-
//! use vortex_vector::{DVectorMut, VectorMutOps, VectorOps};
120+
//! use vortex_vector::decimal::DVectorMut;
121+
//! use vortex_vector::{VectorMutOps, VectorOps};
118122
//!
119123
//! // Create a mutable decimal vector.
120124
//! let decimal_dtype = DecimalDType::new(18, 6); // High precision with 6 decimal places.

vortex-vector/src/fixed_size_list/mod.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
//! be null.
1212
//!
1313
//! ```
14-
//! use vortex_vector::{FixedSizeListVectorMut, PVectorMut, VectorMut, VectorMutOps};
14+
//! use vortex_vector::fixed_size_list::FixedSizeListVectorMut;
15+
//! use vortex_vector::primitive::PVectorMut;
16+
//! use vortex_vector::{VectorMut, VectorMutOps};
1517
//! use vortex_mask::{Mask, MaskMut};
1618
//!
1719
//! // Create elements with some null values.
@@ -46,7 +48,9 @@
4648
//! [`unsplit()`]: crate::VectorMutOps::unsplit
4749
//!
4850
//! ```
49-
//! use vortex_vector::{FixedSizeListVectorMut, PVectorMut, VectorMut, VectorMutOps};
51+
//! use vortex_vector::fixed_size_list::FixedSizeListVectorMut;
52+
//! use vortex_vector::primitive::PVectorMut;
53+
//! use vortex_vector::{VectorMut, VectorMutOps};
5054
//! use vortex_mask::MaskMut;
5155
//!
5256
//! // Create a vector with 6 lists, each containing 2 integers.

vortex-vector/src/macros.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
/// # Examples
1313
///
1414
/// ```
15-
/// use vortex_vector::{
16-
/// Vector, BoolVectorMut, NullVector, VectorOps, VectorMutOps, match_each_vector
17-
/// };
15+
/// use vortex_vector::Vector;
16+
/// use vortex_vector::bool::BoolVectorMut;
17+
/// use vortex_vector::null::NullVector;
18+
/// use vortex_vector::{VectorOps, VectorMutOps, match_each_vector};
1819
///
1920
/// fn get_vector_length(vector: &Vector) -> usize {
2021
/// match_each_vector!(vector, |v| { v.len() })
@@ -59,9 +60,10 @@ macro_rules! match_each_vector {
5960
/// # Examples
6061
///
6162
/// ```
62-
/// use vortex_vector::{
63-
/// VectorMut, BoolVectorMut, NullVectorMut, VectorMutOps, match_each_vector_mut
64-
/// };
63+
/// use vortex_vector::VectorMut;
64+
/// use vortex_vector::bool::BoolVectorMut;
65+
/// use vortex_vector::null::NullVectorMut;
66+
/// use vortex_vector::{VectorMutOps, match_each_vector_mut};
6567
///
6668
/// fn reserve_space(vector: &mut VectorMut, additional: usize) {
6769
/// match_each_vector_mut!(vector, |v| { v.reserve(additional) })
@@ -140,9 +142,8 @@ macro_rules! __match_vector_pair_arms {
140142
/// # Examples
141143
///
142144
/// ```
143-
/// use vortex_vector::{
144-
/// BoolVector, BoolVectorMut, Vector, VectorMut, VectorMutOps, match_vector_pair
145-
/// };
145+
/// use vortex_vector::{Vector, VectorMut, VectorMutOps, match_vector_pair};
146+
/// use vortex_vector::bool::{BoolVector, BoolVectorMut};
146147
///
147148
/// fn extend_vector(left: &mut VectorMut, right: &Vector) {
148149
/// match_vector_pair!(left, right, |a: VectorMut, b: Vector| {
@@ -160,9 +161,8 @@ macro_rules! __match_vector_pair_arms {
160161
/// Note that the vectors can also be owned:
161162
///
162163
/// ```
163-
/// use vortex_vector::{
164-
/// BoolVector, BoolVectorMut, Vector, VectorMut, VectorMutOps, match_vector_pair
165-
/// };
164+
/// use vortex_vector::{Vector, VectorMut, VectorMutOps, match_vector_pair};
165+
/// use vortex_vector::bool::{BoolVector, BoolVectorMut};
166166
///
167167
/// fn extend_vector_owned(mut dest: VectorMut, src: Vector) -> VectorMut {
168168
/// match_vector_pair!(&mut dest, src, |a: VectorMut, b: Vector| {

vortex-vector/src/primitive/iter.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ impl<T: NativePType> Extend<Option<T>> for PVectorMut<T> {
1616
/// # Examples
1717
///
1818
/// ```
19-
/// use vortex_vector::{PVectorMut, VectorMutOps, VectorOps};
19+
/// use vortex_vector::primitive::PVectorMut;
20+
/// use vortex_vector::{VectorMutOps, VectorOps};
2021
///
2122
/// let mut vec = PVectorMut::from_iter([Some(1i32), None]);
2223
/// vec.extend([Some(3), None, Some(5)]);
@@ -93,7 +94,8 @@ impl<T: NativePType> FromIterator<T> for PVectorMut<T> {
9394
/// # Examples
9495
///
9596
/// ```
96-
/// use vortex_vector::{PVectorMut, VectorMutOps};
97+
/// use vortex_vector::primitive::PVectorMut;
98+
/// use vortex_vector::VectorMutOps;
9799
///
98100
/// let mut vec = PVectorMut::from_iter([1i32, 2, 3, 4]);
99101
/// assert_eq!(vec.len(), 4);
@@ -158,7 +160,7 @@ impl<T: NativePType> IntoIterator for PVectorMut<T> {
158160
/// # Examples
159161
///
160162
/// ```
161-
/// use vortex_vector::PVectorMut;
163+
/// use vortex_vector::primitive::PVectorMut;
162164
///
163165
/// let vec = PVectorMut::<i32>::from_iter([Some(1), None, Some(3), Some(4)]);
164166
/// let collected: Vec<_> = vec.into_iter().collect();

vortex-vector/src/primitive/macros.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
/// # Examples
1818
///
1919
/// ```
20-
/// use vortex_vector::{PrimitiveVector, PVectorMut, VectorOps, VectorMutOps, match_each_pvector};
20+
/// use vortex_vector::primitive::{PrimitiveVector, PVectorMut};
21+
/// use vortex_vector::{VectorOps, VectorMutOps, match_each_pvector};
2122
///
2223
/// fn get_primitive_len(vector: &PrimitiveVector) -> usize {
2324
/// match_each_pvector!(vector, |v| { v.len() })
@@ -69,7 +70,8 @@ macro_rules! match_each_pvector {
6970
/// # Examples
7071
///
7172
/// ```
72-
/// use vortex_vector::{PrimitiveVectorMut, PVectorMut, VectorMutOps, match_each_pvector_mut};
73+
/// use vortex_vector::primitive::{PrimitiveVectorMut, PVectorMut};
74+
/// use vortex_vector::{VectorMutOps, match_each_pvector_mut};
7375
///
7476
/// fn reserve_primitive_space(vector: &mut PrimitiveVectorMut, additional: usize) {
7577
/// match_each_pvector_mut!(vector, |v| { v.reserve(additional) })

vortex-vector/src/primitive/mod.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
//! ## Creating and building a vector
1717
//!
1818
//! ```
19-
//! use vortex_vector::{PVectorMut, VectorMutOps};
19+
//! use vortex_vector::primitive::PVectorMut;
20+
//! use vortex_vector::VectorMutOps;
2021
//!
2122
//! // Create with initial capacity for i32 values.
2223
//! let mut vec = PVectorMut::<i32>::with_capacity(10);
@@ -35,7 +36,8 @@
3536
//! ## Extending and appending
3637
//!
3738
//! ```
38-
//! use vortex_vector::{PVectorMut, VectorMutOps};
39+
//! use vortex_vector::primitive::PVectorMut;
40+
//! use vortex_vector::VectorMutOps;
3941
//!
4042
//! let mut vec1 = PVectorMut::<i32>::from_iter([1, 2].map(Some));
4143
//! let vec2 = PVectorMut::<i32>::from_iter([3, 4].map(Some)).freeze();
@@ -52,7 +54,8 @@
5254
//! ## Splitting and unsplitting
5355
//!
5456
//! ```
55-
//! use vortex_vector::{PVectorMut, VectorMutOps};
57+
//! use vortex_vector::primitive::PVectorMut;
58+
//! use vortex_vector::VectorMutOps;
5659
//!
5760
//! let mut vec = PVectorMut::<i64>::from_iter([10, 20, 30, 40, 50].map(Some));
5861
//!
@@ -69,7 +72,8 @@
6972
//! ## Working with nulls
7073
//!
7174
//! ```
72-
//! use vortex_vector::{PVectorMut, VectorMutOps};
75+
//! use vortex_vector::primitive::PVectorMut;
76+
//! use vortex_vector::VectorMutOps;
7377
//!
7478
//! // Create a vector with some null values.
7579
//! let mut vec = PVectorMut::<u32>::from_iter([Some(100), None, Some(200), None]);
@@ -83,7 +87,8 @@
8387
//! ## Converting to immutable
8488
//!
8589
//! ```
86-
//! use vortex_vector::{PVectorMut, VectorMutOps, VectorOps};
90+
//! use vortex_vector::primitive::PVectorMut;
91+
//! use vortex_vector::{VectorMutOps, VectorOps};
8792
//!
8893
//! let mut vec = PVectorMut::<f32>::from_iter([1.0, 2.0, 3.0].map(Some));
8994
//!

vortex-vector/src/struct_/mod.rs

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@
88
//! ## Creating a [`StructVector`] and [`StructVectorMut`]
99
//!
1010
//! ```
11-
//! use vortex_vector::{
12-
//! BoolVectorMut, NullVectorMut, PVectorMut, StructVectorMut, VectorMut, VectorMutOps,
13-
//! };
11+
//! use vortex_vector::bool::BoolVectorMut;
12+
//! use vortex_vector::null::NullVectorMut;
13+
//! use vortex_vector::primitive::PVectorMut;
14+
//! use vortex_vector::struct_::StructVectorMut;
15+
//! use vortex_vector::{VectorMut, VectorMutOps};
1416
//! use vortex_mask::MaskMut;
1517
//!
1618
//! // Create a struct with three fields: nulls, booleans, and integers.
@@ -30,9 +32,11 @@
3032
//! [`unsplit()`]: crate::VectorMutOps::unsplit
3133
//!
3234
//! ```
33-
//! use vortex_vector::{
34-
//! BoolVectorMut, NullVectorMut, PVectorMut, StructVectorMut, VectorMut, VectorMutOps,
35-
//! };
35+
//! use vortex_vector::bool::BoolVectorMut;
36+
//! use vortex_vector::null::NullVectorMut;
37+
//! use vortex_vector::primitive::PVectorMut;
38+
//! use vortex_vector::struct_::StructVectorMut;
39+
//! use vortex_vector::{VectorMut, VectorMutOps};
3640
//! use vortex_mask::MaskMut;
3741
//!
3842
//! let fields = Box::new([
@@ -56,9 +60,11 @@
5660
//! ## Accessing field values
5761
//!
5862
//! ```
59-
//! use vortex_vector::{
60-
//! BoolVectorMut, NullVectorMut, PVectorMut, StructVectorMut, VectorMut, VectorMutOps,
61-
//! };
63+
//! use vortex_vector::bool::BoolVectorMut;
64+
//! use vortex_vector::null::NullVectorMut;
65+
//! use vortex_vector::primitive::PVectorMut;
66+
//! use vortex_vector::struct_::StructVectorMut;
67+
//! use vortex_vector::{VectorMut, VectorMutOps};
6268
//! use vortex_mask::MaskMut;
6369
//! use vortex_dtype::PTypeDowncast;
6470
//!

0 commit comments

Comments
 (0)