Fix some clippy::complexity
This commit is contained in:
parent
6fceb0f645
commit
81c320ea77
28 changed files with 62 additions and 63 deletions
|
@ -1850,7 +1850,7 @@ impl<R: Idx, C: Idx> SparseBitMatrix<R, C> {
|
|||
|
||||
/// Iterates through all the columns set to true in a given row of
|
||||
/// the matrix.
|
||||
pub fn iter<'a>(&'a self, row: R) -> impl Iterator<Item = C> + 'a {
|
||||
pub fn iter(&self, row: R) -> impl Iterator<Item = C> + '_ {
|
||||
self.row(row).into_iter().flat_map(|r| r.iter())
|
||||
}
|
||||
|
||||
|
|
|
@ -201,18 +201,15 @@ impl<I: Idx, T> IndexVec<I, T> {
|
|||
}
|
||||
|
||||
#[inline]
|
||||
pub fn drain<'a, R: RangeBounds<usize>>(
|
||||
&'a mut self,
|
||||
range: R,
|
||||
) -> impl Iterator<Item = T> + 'a {
|
||||
pub fn drain<R: RangeBounds<usize>>(&mut self, range: R) -> impl Iterator<Item = T> + '_ {
|
||||
self.raw.drain(range)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn drain_enumerated<'a, R: RangeBounds<usize>>(
|
||||
&'a mut self,
|
||||
pub fn drain_enumerated<R: RangeBounds<usize>>(
|
||||
&mut self,
|
||||
range: R,
|
||||
) -> impl Iterator<Item = (I, T)> + 'a {
|
||||
) -> impl Iterator<Item = (I, T)> + '_ {
|
||||
let begin = match range.start_bound() {
|
||||
std::ops::Bound::Included(i) => *i,
|
||||
std::ops::Bound::Excluded(i) => i.checked_add(1).unwrap(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue