Skip to content

Commit

Permalink
Merge pull request #4 from aliemjay/fix-annotations
Browse files Browse the repository at this point in the history
fix type annotations to not require `Self: 'this`
  • Loading branch information
vigna authored Nov 16, 2023
2 parents a48458c + 94eba15 commit c459fe9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/adapters/intersperse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ where
self.needs_sep = false;
// SAFETY: 'this: 'lend
Some(unsafe {
core::mem::transmute::<<Self as Lending<'this>>::Lend, <Self as Lending<'_>>::Lend>((self.separator)())
core::mem::transmute::<<L as Lending<'this>>::Lend, <L as Lending<'_>>::Lend>((self.separator)())
})
} else {
self.needs_sep = true;
Expand Down
4 changes: 2 additions & 2 deletions src/sources/from_iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ where
#[inline]
fn next(&mut self) -> Option<Lend<'_, Self>> {
// SAFETY: 'a: 'lend
unsafe { core::mem::transmute::<Option<Lend<'a, Self>>, Option<Lend<'_, Self>>>(self.iter.next()) }
unsafe { core::mem::transmute::<Option<Lend<'a, L>>, Option<Lend<'_, L>>>(self.iter.next()) }
}
#[inline]
fn size_hint(&self) -> (usize, Option<usize>) {
Expand All @@ -190,7 +190,7 @@ where
{
fn next_back(&mut self) -> Option<Lend<'_, Self>> {
// SAFETY: 'a: 'lend
unsafe { core::mem::transmute::<Option<Lend<'a, Self>>, Option<Lend<'_, Self>>>(self.iter.next_back()) }
unsafe { core::mem::transmute::<Option<Lend<'a, L>>, Option<Lend<'_, L>>>(self.iter.next_back()) }
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/sources/repeat_with.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ where
#[inline]
fn next(&mut self) -> Option<<Self as Lending<'_>>::Lend> {
// SAFETY: 'a: 'lend
Some(unsafe { core::mem::transmute::<<Self as Lending<'a>>::Lend, <Self as Lending<'_>>::Lend>((self.f)()) })
Some(unsafe { core::mem::transmute::<<L as Lending<'a>>::Lend, <L as Lending<'_>>::Lend>((self.f)()) })
}
#[inline]
fn advance_by(&mut self, _n: usize) -> Result<(), core::num::NonZeroUsize> {
Expand Down

0 comments on commit c459fe9

Please sign in to comment.