diff options
| author | Clemens Wasser <clemens.wasser@gmail.com> | 2021-10-09 20:44:22 +0200 |
|---|---|---|
| committer | Clemens Wasser <clemens.wasser@gmail.com> | 2021-10-10 15:38:19 +0200 |
| commit | 71dd0b928b8b175b69e56fc58e5878b73f090718 (patch) | |
| tree | aeffddc5806cdc0d8b3d866d13c6235385b876a5 /compiler/rustc_index | |
| parent | 15491d7b6be1065217e09bd735e4ecffbe9838ba (diff) | |
| download | rust-71dd0b928b8b175b69e56fc58e5878b73f090718.tar.gz rust-71dd0b928b8b175b69e56fc58e5878b73f090718.zip | |
Apply clippy suggestions
Diffstat (limited to 'compiler/rustc_index')
| -rw-r--r-- | compiler/rustc_index/src/bit_set.rs | 6 | ||||
| -rw-r--r-- | compiler/rustc_index/src/vec.rs | 11 |
2 files changed, 7 insertions, 10 deletions
diff --git a/compiler/rustc_index/src/bit_set.rs b/compiler/rustc_index/src/bit_set.rs index 5b1add4cfc6..d3c7a390cd5 100644 --- a/compiler/rustc_index/src/bit_set.rs +++ b/compiler/rustc_index/src/bit_set.rs @@ -991,8 +991,8 @@ impl<R: Idx, C: Idx> BitMatrix<R, C> { assert!(row.index() < self.num_rows); let (start, end) = self.range(row); let words = &mut self.words[..]; - for index in start..end { - words[index] = !0; + for word in words[start..end].iter_mut() { + *word = !0; } self.clear_excess_bits(row); } @@ -1144,7 +1144,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()) } diff --git a/compiler/rustc_index/src/vec.rs b/compiler/rustc_index/src/vec.rs index 88315246834..e9efa2f255d 100644 --- a/compiler/rustc_index/src/vec.rs +++ b/compiler/rustc_index/src/vec.rs @@ -634,18 +634,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)> + '_ { self.raw.drain(range).enumerate().map(|(n, t)| (I::new(n), t)) } |
