Skip to content

Commit

Permalink
Fix some missing #[must_use]
Browse files Browse the repository at this point in the history
  • Loading branch information
LDeakin committed Dec 22, 2023
1 parent 90ab1f1 commit a940ea5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -386,11 +386,13 @@ impl<TStorage: ?Sized> Array<TStorage> {
}

/// Create an array builder matching the parameters of this array
#[must_use]
pub fn builder(&self) -> ArrayBuilder {
ArrayBuilder::from_array(self)
}

/// Return the shape of the chunk grid (i.e., the number of chunks).
#[must_use]
pub fn chunk_grid_shape(&self) -> Option<Vec<u64>> {
unsafe { self.chunk_grid().grid_shape_unchecked(self.shape()) }
}
Expand Down
4 changes: 1 addition & 3 deletions src/array/array_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ impl ArrayBuilder {
}

/// Create a new builder copying the configuration of an existing array.
#[must_use]
pub fn from_array<T: ?Sized>(array: &Array<T>) -> Self {
let mut builder = Self::new(
array.shape().to_vec(),
Expand Down Expand Up @@ -307,9 +308,6 @@ impl ArrayBuilder {
dimension_names: self.dimension_names.clone(),
additional_fields: self.additional_fields.clone(),
parallel_codecs: self.parallel_codecs,
chunk_locks: parking_lot::Mutex::default(),
#[cfg(feature = "async")]
async_chunk_locks: async_lock::Mutex::default(),
include_zarrs_metadata: true,
})
}
Expand Down

0 comments on commit a940ea5

Please sign in to comment.