Skip to content

Commit

Permalink
Clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
magnusuMET committed Oct 10, 2024
1 parent 3dc5b08 commit 1aa138c
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/extent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ enum ExtentIterator<'a> {
Extents(std::iter::Zip<std::slice::Iter<'a, Extent>, std::slice::Iter<'a, u64>>),
}

impl<'a> Iterator for ExtentIterator<'a> {
impl Iterator for ExtentIterator<'_> {
type Item = Extent;
fn next(&mut self) -> Option<Self::Item> {
match self {
Expand All @@ -395,7 +395,7 @@ impl<'a> Iterator for ExtentIterator<'a> {
}
}

impl<'a> DoubleEndedIterator for ExtentIterator<'a> {
impl DoubleEndedIterator for ExtentIterator<'_> {
fn next_back(&mut self) -> Option<Self::Item> {
match self {
Self::All(iter) => iter
Expand Down
2 changes: 1 addition & 1 deletion src/idx/dataset/any.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ pub trait DatasetExt {
fn as_par_reader(&self, p: &dyn AsRef<Path>) -> anyhow::Result<Box<dyn DatasetExtReader + '_>>;
}

impl<'a> DatasetExt for DatasetD<'a> {
impl DatasetExt for DatasetD<'_> {
fn size(&self) -> usize {
self.inner().size()
}
Expand Down
4 changes: 2 additions & 2 deletions src/idx/dataset/dataset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ impl<const D: usize> Dataset<'_, D> {
let expected_chunks = shape
.iter()
.zip(&chunk_shape)
.map(|(s, c)| (s + (c - 1)) / c)
.map(|(s, c)| s.div_ceil(*c))
.product::<u64>() as usize;

ensure!(
Expand Down Expand Up @@ -194,7 +194,7 @@ impl<const D: usize> Dataset<'_, D> {
let mut d = shape
.iter()
.zip(&chunk_shape)
.map(|(d, z)| (d + (z - 1)) / z)
.map(|(d, z)| d.div_ceil(*z))
.rev()
.scan(1, |p, c| {
let sz = *p;
Expand Down
2 changes: 1 addition & 1 deletion src/reader/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl<'a, R: Read + Seek, const D: usize> CacheReader<'a, R, D> {
}
}

impl<'a, R: Read + Seek, const D: usize> Reader for CacheReader<'a, R, D> {
impl<R: Read + Seek, const D: usize> Reader for CacheReader<'_, R, D> {
fn order(&self) -> Order {
self.ds.order
}
Expand Down
4 changes: 2 additions & 2 deletions src/reader/direct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl<'a, const D: usize> Direct<'a, D> {
}
}

impl<'a, const D: usize> ParReader for Direct<'a, D> {
impl<const D: usize> ParReader for Direct<'_, D> {
fn read_to_par(&self, extents: &Extents, dst: &mut [u8]) -> Result<usize, anyhow::Error> {
use rayon::prelude::*;

Expand Down Expand Up @@ -97,7 +97,7 @@ impl<'a, const D: usize> ParReader for Direct<'a, D> {
}
}

impl<'a, const D: usize> Reader for Direct<'a, D> {
impl<const D: usize> Reader for Direct<'_, D> {
fn order(&self) -> Order {
self.ds.order
}
Expand Down
2 changes: 1 addition & 1 deletion src/reader/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl<'a, const D: usize> StreamReader<'a, D> {
}
}

impl<'a, const D: usize> Streamer for StreamReader<'a, D> {
impl<const D: usize> Streamer for StreamReader<'_, D> {
fn dsize(&self) -> usize {
self.ds.dsize
}
Expand Down

0 comments on commit 1aa138c

Please sign in to comment.