Skip to content

Commit

Permalink
chore: fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
m4tx committed Dec 1, 2024
1 parent 6ccbe4e commit f5e22aa
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/b64_decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ impl<'a, const N: usize> B64RansDecoderMulti<'a, N> {
}
}

impl<'a, const N: usize> RansDecoderMulti<N> for B64RansDecoderMulti<'a, N> {
impl<const N: usize> RansDecoderMulti<N> for B64RansDecoderMulti<'_, N> {
type Symbol = B64RansDecSymbol;

#[inline]
Expand Down Expand Up @@ -107,7 +107,7 @@ impl<'a, const N: usize> RansDecoderMulti<N> for B64RansDecoderMulti<'a, N> {
}
}

impl<'a> RansDecoder for B64RansDecoderMulti<'a, 1> {}
impl RansDecoder for B64RansDecoderMulti<'_, 1> {}

/// rANS decoder symbol - 64-bit version.
#[derive(Debug, Clone)]
Expand Down Expand Up @@ -170,15 +170,15 @@ mod tests {
let mut data = [
122, 27, 118, 146, 40, 184, 212, 0, 147, 60, 144, 230, 24, 137, 205, 128,
];
let decoder = B64RansDecoder::new(&mut data);
let decoder = B64RansDecoder::new(data);

dec_tests::test_decode_more_data(decoder);
}

#[test]
fn test_decode_interleaved() {
let mut data = [108, 0, 0, 0, 128, 0, 0, 0, 0, 0, 0, 0, 128, 0, 0, 0];
let decoder = B64RansDecoderMulti::<2>::new(&mut data);
let decoder = B64RansDecoderMulti::<2>::new(data);

dec_tests::test_decode_interleaved(decoder);
}
Expand Down
8 changes: 4 additions & 4 deletions src/byte_decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ impl<'a, const N: usize> ByteRansDecoderMulti<'a, N> {
}
}

impl<'a, const N: usize> RansDecoderMulti<N> for ByteRansDecoderMulti<'a, N> {
impl<const N: usize> RansDecoderMulti<N> for ByteRansDecoderMulti<'_, N> {
type Symbol = ByteRansDecSymbol;

#[inline]
Expand Down Expand Up @@ -107,7 +107,7 @@ impl<'a, const N: usize> RansDecoderMulti<N> for ByteRansDecoderMulti<'a, N> {
}
}

impl<'a> RansDecoder for ByteRansDecoderMulti<'a, 1> {}
impl RansDecoder for ByteRansDecoderMulti<'_, 1> {}

/// rANS decoder symbol - byte-aligned version.
#[derive(Debug, Clone)]
Expand Down Expand Up @@ -170,15 +170,15 @@ mod tests {
let mut data = [
106, 184, 212, 0, 84, 205, 93, 162, 171, 34, 28, 50, 161, 66, 2,
];
let decoder = ByteRansDecoder::new(&mut data);
let decoder = ByteRansDecoder::new(data);

dec_tests::test_decode_more_data(decoder);
}

#[test]
fn test_decode_interleaved() {
let mut data = [12, 0, 128, 0, 0, 0, 128, 0, 24, 0];
let decoder = ByteRansDecoderMulti::<2>::new(&mut data);
let decoder = ByteRansDecoderMulti::<2>::new(data);

dec_tests::test_decode_interleaved(decoder);
}
Expand Down
8 changes: 4 additions & 4 deletions src/mut_cow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,19 @@ impl<'a, const N: usize> From<&'a mut [u8; N]> for MutCow<'a, [u8]> {
}
}

impl<'a, const N: usize> From<[u8; N]> for MutCow<'a, [u8]> {
impl<const N: usize> From<[u8; N]> for MutCow<'_, [u8]> {
fn from(owned: [u8; N]) -> Self {
Self::Owned(Vec::from(owned))
}
}

impl<'a> From<Vec<u8>> for MutCow<'a, [u8]> {
impl From<Vec<u8>> for MutCow<'_, [u8]> {
fn from(owned: Vec<u8>) -> Self {
Self::Owned(owned)
}
}

impl<'a> Deref for MutCow<'a, [u8]> {
impl Deref for MutCow<'_, [u8]> {
type Target = [u8];

fn deref(&self) -> &Self::Target {
Expand All @@ -66,7 +66,7 @@ impl<'a> Deref for MutCow<'a, [u8]> {
}
}

impl<'a> DerefMut for MutCow<'a, [u8]> {
impl DerefMut for MutCow<'_, [u8]> {
fn deref_mut(&mut self) -> &mut Self::Target {
match self {
MutCow::Borrowed(reference) => reference,
Expand Down

0 comments on commit f5e22aa

Please sign in to comment.