Skip to content

Commit

Permalink
FIX: Rewrite size_hint to fix clippy lint
Browse files Browse the repository at this point in the history
Fix warning 'this match could be written as a `let` statement'
  • Loading branch information
bluss committed Apr 12, 2020
1 parent 869f324 commit c913363
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/indexes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,18 +273,14 @@ where
if !self.has_remaining {
return (0, Some(0));
}
let l = match self.index {
ref ix => {
let gone = self
.dim
.fortran_strides()
.slice()
.iter()
.zip(ix.slice().iter())
.fold(0, |s, (&a, &b)| s + a as usize * b as usize);
self.dim.size() - gone
}
};
let gone = self
.dim
.fortran_strides()
.slice()
.iter()
.zip(self.index.slice().iter())
.fold(0, |s, (&a, &b)| s + a as usize * b as usize);
let l = self.dim.size() - gone;
(l, Some(l))
}
}
Expand Down

0 comments on commit c913363

Please sign in to comment.