Skip to content

Commit

Permalink
Fix clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
juntyr committed Aug 6, 2024
1 parent e857541 commit 10950a5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ rust-version = "1.64"

[workspace.dependencies]
# workspace-internal numcodecs crates
numcodecs = { path = "crates/numcodecs", default-features = false }
numcodecs-python = { path = "crates/numcodecs-python", default-features = false }
numcodecs = { version = "0.1", path = "crates/numcodecs", default-features = false }
numcodecs-python = { version = "0.1", path = "crates/numcodecs-python", default-features = false }

# workspace-internal codecs crates
numcodecs-bit-round = { path = "codecs/bit-round", default-features = false }
numcodecs-bit-round = { version = "0.1", path = "codecs/bit-round", default-features = false }

# crates.io third-party dependencies
convert_case = { version = "0.6", default-features = false }
Expand Down
18 changes: 10 additions & 8 deletions codecs/bit-round/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ impl Codec for BitRoundCodec {
encoded: AnyArrayView,
mut decoded: AnyArrayViewMut,
) -> Result<(), Self::Error> {
#[allow(clippy::unit_arg)]
match (&encoded, &mut decoded) {
(AnyArrayView::F32(encoded), AnyArrayViewMut::F32(decoded)) => {
Ok(decoded.assign(encoded))
Expand Down Expand Up @@ -95,23 +96,24 @@ impl StaticCodec for BitRoundCodec {
#[derive(Debug, Error)]
/// Errors that may occur when applying the [`BitRoundCodec`].
pub enum BitRoundError {
/// BitRound does not support the dtype
/// [`BitRoundCodec`] does not support the dtype
#[error("BitRound does not support the dtype {0}")]
UnsupportedDtype(AnyArrayDType),
/// BitRound cannot decode the decoded dtype into provided array
/// [`BitRoundCodec`] cannot decode the `decoded` dtype into the `provided`
/// array
#[error("BitRound cannot decode the dtype {decoded} into the provided {provided} array")]
MismatchedDecodeIntoDtype {
/// Dtype of the decoded data
/// Dtype of the `decoded` data
decoded: AnyArrayDType,
/// Dtype of the provided array into which the data is to be decoded
/// Dtype of the `provided` array into which the data is to be decoded
provided: AnyArrayDType,
},
/// BitRound encode `keepbits` exceed the mantissa size for `dtype`
/// [`BitRoundCodec`] encode `keepbits` exceed the mantissa size for `dtype`
#[error("BitRound encode {keepbits} bits exceed the mantissa size for {dtype}")]
ExcessiveKeepBits {
/// The number of bits of the mantissa to keep
keepbits: u8,
/// The dtype of the data to encode
/// The `dtype` of the data to encode
dtype: AnyArrayDType,
},
}
Expand All @@ -124,9 +126,9 @@ pub enum BitRoundError {
/// to be compressed.
///
/// The approach is based on the paper by Klöwer et al. 2021
/// (https://www.nature.com/articles/s43588-021-00156-2).
/// (<https://www.nature.com/articles/s43588-021-00156-2>).
///
/// See https://github.com/milankl/BitInformation.jl for the the original
/// See <https://github.com/milankl/BitInformation.jl> for the the original
/// implementation in Julia.
///
/// # Errors
Expand Down

0 comments on commit 10950a5

Please sign in to comment.