Skip to content

Commit

Permalink
Clippy nursery fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
LDeakin committed Feb 19, 2024
1 parent c4283f1 commit 63bf032
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/array/array_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl<'a> ArrayView<'a> {
Err(IncompatibleDimensionalityError::new(subset.dimensionality(), shape.len()).into())
} else if std::iter::zip(subset.end_exc(), shape).any(|(end, &shape)| end > shape) {
Err(ArrayViewCreateError::ArraySubsetOutOfBounds(
subset.clone(),
subset,
shape.to_vec(),
))
} else {
Expand Down
4 changes: 1 addition & 3 deletions src/array/chunk_grid/rectangular.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ fn is_name_rectangular(name: &str) -> bool {
name.eq(IDENTIFIER)
}

pub(crate) fn create_chunk_grid_rectangular(
metadata: &Metadata,
) -> Result<ChunkGrid, PluginCreateError> {
pub fn create_chunk_grid_rectangular(metadata: &Metadata) -> Result<ChunkGrid, PluginCreateError> {
let configuration: RectangularChunkGridConfiguration = metadata
.to_configuration()
.map_err(|_| PluginMetadataInvalidError::new(IDENTIFIER, "chunk grid", metadata.clone()))?;
Expand Down
4 changes: 1 addition & 3 deletions src/array/chunk_grid/regular.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ fn is_name_regular(name: &str) -> bool {
name.eq(IDENTIFIER)
}

pub(crate) fn create_chunk_grid_regular(
metadata: &Metadata,
) -> Result<ChunkGrid, PluginCreateError> {
pub fn create_chunk_grid_regular(metadata: &Metadata) -> Result<ChunkGrid, PluginCreateError> {
let configuration: RegularChunkGridConfiguration = metadata
.to_configuration()
.map_err(|_| PluginMetadataInvalidError::new(IDENTIFIER, "chunk grid", metadata.clone()))?;
Expand Down
2 changes: 1 addition & 1 deletion src/array/chunk_key_encoding/default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fn is_name_default(name: &str) -> bool {
name.eq(IDENTIFIER)
}

pub(crate) fn create_chunk_key_encoding_default(
pub fn create_chunk_key_encoding_default(
metadata: &Metadata,
) -> Result<ChunkKeyEncoding, PluginCreateError> {
let configuration: DefaultChunkKeyEncodingConfiguration =
Expand Down
2 changes: 1 addition & 1 deletion src/array/chunk_key_encoding/v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fn is_name_v2(name: &str) -> bool {
name.eq(IDENTIFIER)
}

pub(crate) fn create_chunk_key_encoding_v2(
pub fn create_chunk_key_encoding_v2(
metadata: &Metadata,
) -> Result<ChunkKeyEncoding, PluginCreateError> {
let configuration: V2ChunkKeyEncodingConfiguration =
Expand Down
2 changes: 1 addition & 1 deletion src/array/chunk_shape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl ChunkShape {

impl From<ChunkShape> for Vec<NonZeroU64> {
fn from(val: ChunkShape) -> Self {
val.0.clone()
val.0
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/array/codec/array_to_bytes/pcodec/pcodec_configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pub struct PcodecCodecConfigurationV1 {

impl Default for PcodecCodecConfigurationV1 {
fn default() -> Self {
PcodecCodecConfigurationV1 {
Self {
level: default_compression(),
delta_encoding_order: None,
int_mult_spec: default_mult_spec(),
Expand All @@ -69,11 +69,11 @@ fn default_compression() -> PcodecCompressionLevel {
PcodecCompressionLevel::default()
}

fn default_mult_spec() -> bool {
const fn default_mult_spec() -> bool {
true
}

fn default_max_page_n() -> usize {
const fn default_max_page_n() -> usize {
// pco::constants::DEFAULT_MAX_PAGE_N
1 << 18
}
Expand Down
3 changes: 1 addition & 2 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ use std::sync::{OnceLock, RwLock, RwLockReadGuard, RwLockWriteGuard};
/// For array operations involving multiple chunks, this is the preferred minimum chunk concurrency.
/// For example, `array_store_chunks` will concurrently encode and store four chunks at a time by default.
/// The concurrency of internal codecs is adjusted to accomodate for the chunk concurrency in accordance with the concurrent target set in the [`CodecOptions`](crate::array::codec::CodecOptions) parameter of an encode or decode method.
#[derive(Debug)]
pub struct Config {
validate_checksums: bool,
Expand All @@ -44,7 +43,7 @@ impl Default for Config {
fn default() -> Self {
let concurrency_multiply = 1;
let concurrency_add = 0;
Config {
Self {
validate_checksums: true,
codec_concurrent_target: std::thread::available_parallelism().unwrap().get()
* concurrency_multiply
Expand Down

0 comments on commit 63bf032

Please sign in to comment.