#[inline]
unsafe fn as_inner(&mut self) -> &mut S {
- // Safety: unsafe function forwarding to unsafe function with the same requirements
+ // SAFETY: unsafe function forwarding to unsafe function with the same requirements
unsafe { SourceIter::as_inner(&mut self.iter) }
}
}
#[inline]
unsafe fn as_inner(&mut self) -> &mut S {
- // Safety: unsafe function forwarding to unsafe function with the same requirements
+ // SAFETY: unsafe function forwarding to unsafe function with the same requirements
unsafe { SourceIter::as_inner(&mut self.iter) }
}
}
) -> impl FnMut((), T) -> ControlFlow<(), B> + '_ {
move |(), x| match f(x) {
Some(x) => ControlFlow::Break(x),
- None => ControlFlow::Continue(()),
+ None => ControlFlow::CONTINUE,
}
}
#[inline]
unsafe fn as_inner(&mut self) -> &mut S {
- // Safety: unsafe function forwarding to unsafe function with the same requirements
+ // SAFETY: unsafe function forwarding to unsafe function with the same requirements
unsafe { SourceIter::as_inner(&mut self.iter) }
}
}
#[inline]
unsafe fn as_inner(&mut self) -> &mut S {
- // Safety: unsafe function forwarding to unsafe function with the same requirements
+ // SAFETY: unsafe function forwarding to unsafe function with the same requirements
unsafe { SourceIter::as_inner(&mut self.iter) }
}
}
self.peeked.get_or_insert_with(|| iter.next()).as_ref()
}
- /// Consume the next value of this iterator if a condition is true.
+ /// Consume and return the next value of this iterator if a condition is true.
///
/// If `func` returns `true` for the next value of this iterator, consume and return it.
/// Otherwise, return `None`.
}
}
- /// Consume the next item if it is equal to `expected`.
+ /// Consume and return the next item if it is equal to `expected`.
///
/// # Example
/// Consume a number if it's equal to 0.
/// assert_eq!(iter.next(), Some(1));
/// ```
#[unstable(feature = "peekable_next_if", issue = "72480")]
- pub fn next_if_eq<R>(&mut self, expected: &R) -> Option<I::Item>
+ pub fn next_if_eq<T>(&mut self, expected: &T) -> Option<I::Item>
where
- R: ?Sized,
- I::Item: PartialEq<R>,
+ T: ?Sized,
+ I::Item: PartialEq<T>,
{
self.next_if(|next| next == expected)
}
#[inline]
unsafe fn as_inner(&mut self) -> &mut S {
- // Safety: unsafe function forwarding to unsafe function with the same requirements
+ // SAFETY: unsafe function forwarding to unsafe function with the same requirements
unsafe { SourceIter::as_inner(&mut self.iter) }
}
}
#[inline]
unsafe fn as_inner(&mut self) -> &mut S {
- // Safety: unsafe function forwarding to unsafe function with the same requirements
+ // SAFETY: unsafe function forwarding to unsafe function with the same requirements
unsafe { SourceIter::as_inner(&mut self.iter) }
}
}
#[inline]
unsafe fn as_inner(&mut self) -> &mut S {
- // Safety: unsafe function forwarding to unsafe function with the same requirements
+ // SAFETY: unsafe function forwarding to unsafe function with the same requirements
unsafe { SourceIter::as_inner(&mut self.iter) }
}
}
#[inline]
unsafe fn as_inner(&mut self) -> &mut S {
- // Safety: unsafe function forwarding to unsafe function with the same requirements
+ // SAFETY: unsafe function forwarding to unsafe function with the same requirements
unsafe { SourceIter::as_inner(&mut self.iter) }
}
}
#[inline]
unsafe fn as_inner(&mut self) -> &mut S {
- // Safety: unsafe function forwarding to unsafe function with the same requirements
+ // SAFETY: unsafe function forwarding to unsafe function with the same requirements
unsafe { SourceIter::as_inner(&mut self.iter) }
}
}
#[inline]
unsafe fn as_inner(&mut self) -> &mut S {
- // Safety: unsafe function forwarding to unsafe function with the same requirements
+ // SAFETY: unsafe function forwarding to unsafe function with the same requirements
unsafe { SourceIter::as_inner(&mut self.iter) }
}
}
#[inline]
unsafe fn as_inner(&mut self) -> &mut S {
- // Safety: unsafe function forwarding to unsafe function with the same requirements
+ // SAFETY: unsafe function forwarding to unsafe function with the same requirements
unsafe { SourceIter::as_inner(&mut self.iter) }
}
}
#[inline]
unsafe fn as_inner(&mut self) -> &mut S {
- // Safety: unsafe function forwarding to unsafe function with the same requirements
+ // SAFETY: unsafe function forwarding to unsafe function with the same requirements
unsafe { SourceIter::as_inner(&mut self.iter) }
}
}