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

Commit

Permalink
add try_new for MutableNullArray
Browse files Browse the repository at this point in the history
  • Loading branch information
Aryansh Omray committed Nov 6, 2023
1 parent 4366cd6 commit fa0b581
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/array/null.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,16 @@ pub struct MutableNullArray {
}

impl MutableNullArray {
/// Returns a new [`MutableNullArray`].
/// # Errors
/// This function errors iff:
/// * The `data_type`'s [`crate::datatypes::PhysicalType`] is not equal to [`crate::datatypes::PhysicalType::Null`].
pub fn try_new(data_type: DataType, length: usize) -> Result<Self, Error> {
Ok(Self {
inner: NullArray::try_new(data_type, length)?,
})
}

/// Returns a new [`MutableNullArray`].
/// # Panics
/// This function errors iff:
Expand Down

0 comments on commit fa0b581

Please sign in to comment.