Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
Mutable struct push unchecked (#1223)
Browse files Browse the repository at this point in the history
  • Loading branch information
hohav authored Aug 17, 2022
1 parent 0b345ae commit f75ce42
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/array/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//! * [`Utf8Array`] and [`MutableUtf8Array`], an array of variable length utf8 values
//! * [`BinaryArray`] and [`MutableBinaryArray`], an array of opaque variable length values
//! * [`ListArray`] and [`MutableListArray`], an array of arrays (e.g. `[[1, 2], None, [], [None]]`)
//! * [`StructArray`], an array of arrays identified by a string (e.g. `{"a": [1, 2], "b": [true, false]}`)
//! * [`StructArray`] and [`MutableStructArray`], an array of arrays identified by a string (e.g. `{"a": [1, 2], "b": [true, false]}`)
//! All immutable arrays implement the trait object [`Array`] and that can be downcasted
//! to a concrete struct based on [`PhysicalType`](crate::datatypes::PhysicalType) available from [`Array::data_type`].
//! All immutable arrays are backed by [`Buffer`](crate::buffer::Buffer) and thus cloning and slicing them is `O(1)`.
Expand Down
6 changes: 1 addition & 5 deletions src/array/struct_/mutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,7 @@ impl MutableStructArray {
}
}

/// Call this after pushing into each child array.
/// # Panics
/// This function panics if any of the children does not have exactly one more
/// element than before the last call of `push`.
/// Call this once for each "row" of children you push.
pub fn push(&mut self, valid: bool) {
match &mut self.validity {
Some(validity) => validity.push(valid),
Expand All @@ -122,7 +119,6 @@ impl MutableStructArray {
false => self.init_validity(),
},
};
self.assert_lengths();
}

fn push_null(&mut self) {
Expand Down

0 comments on commit f75ce42

Please sign in to comment.