Skip to content

Commit 9705563

Browse files
authored
Improve list builder usage example in docs (#6775)
The example could leave the impression that it is important to append some dummy element (which value is irrelevant) to values builder when constructing null list entry.
1 parent da840ed commit 9705563

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

arrow-array/src/builder/generic_list_builder.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ use std::sync::Arc;
4949
/// builder.append(true);
5050
///
5151
/// // Null
52-
/// builder.values().append_value("?"); // irrelevant
5352
/// builder.append(false);
5453
///
5554
/// // [D]
@@ -70,15 +69,14 @@ use std::sync::Arc;
7069
/// array.values().as_ref(),
7170
/// &StringArray::from(vec![
7271
/// Some("A"), Some("B"), Some("C"),
73-
/// Some("?"), Some("D"), None,
74-
/// Some("F")
72+
/// Some("D"), None, Some("F")
7573
/// ])
7674
/// );
7775
///
7876
/// // Offsets are indexes into the values array
7977
/// assert_eq!(
8078
/// array.value_offsets(),
81-
/// &[0, 3, 3, 4, 5, 7]
79+
/// &[0, 3, 3, 3, 4, 6]
8280
/// );
8381
/// ```
8482
///

0 commit comments

Comments
 (0)