Greatly simplify lifetime captures in edition 2024

This commit is contained in:
Michael Goulet
2025-02-20 18:58:46 +00:00
parent 46420c9607
commit 12e3911d81
84 changed files with 223 additions and 294 deletions

View File

@@ -132,7 +132,7 @@ impl<I: Idx, T> IndexVec<I, T> {
}
#[inline]
pub fn drain<R: RangeBounds<usize>>(&mut self, range: R) -> impl Iterator<Item = T> + '_ {
pub fn drain<R: RangeBounds<usize>>(&mut self, range: R) -> impl Iterator<Item = T> {
self.raw.drain(range)
}
@@ -140,7 +140,7 @@ impl<I: Idx, T> IndexVec<I, T> {
pub fn drain_enumerated<R: RangeBounds<usize>>(
&mut self,
range: R,
) -> impl Iterator<Item = (I, T)> + '_ {
) -> 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(),