use alloc::borrow::ToOwned;
use core::{cmp::Ordering, num::NonZeroUsize, ops::ControlFlow};
use crate::{
Chain, Chunk, Chunky, Cloned, Convert, Copied, Covar, Cycle, DoubleEndedLender, Enumerate,
ExactSizeLender, ExtendLender, Filter, FilterMap, FirstShunt, FlatMap, Flatten, FromIterRef,
FromLender, Fuse, ImplBound, Inspect, Intersperse, IntersperseWith, IntoFallible, IntoLender,
Iter, Map, MapIntoIter, MapWhile, Mutate, Owned, Peekable, ProductLender, Ref, Rev, Scan,
SecondShunt, Skip, SkipWhile, StepBy, SumLender, Take, TakeWhile, TryShunt, TupleLend, Zip,
higher_order::{FnMutHKA, FnMutHKAOpt},
try_process,
try_trait_v2::{ChangeOutputType, FromResidual, Residual, Try, internal::NeverShortCircuit},
unzip,
};
pub trait Lending<'lend, __ImplBound: ImplBound = Ref<'lend, Self>> {
type Lend: 'lend;
}
pub type Lend<'lend, L> = <L as Lending<'lend>>::Lend;
pub trait Lender: for<'all > Lending<'all> {
fn __check_covariance<'long: 'short, 'short>(
proof: crate::CovariantProof<<Self as Lending<'long>>::Lend>,
) -> crate::CovariantProof<<Self as Lending<'short>>::Lend>;
fn next(&mut self) -> Option<Lend<'_, Self>>;
#[inline(always)]
fn next_chunk(&mut self, chunk_size: usize) -> Chunk<'_, Self>
where
Self: Sized,
{
Chunk::new(self, chunk_size)
}
#[inline(always)]
fn size_hint(&self) -> (usize, Option<usize>) { (0, None) }
#[inline(always)]
fn count(self) -> usize
where
Self: Sized,
{
self.fold(0, |count, _| count + 1)
}
#[inline]
fn last<'call>(&'call mut self) -> Option<Lend<'call, Self>>
where
Self: Sized,
{
let mut last = None;
while let Some(x) = self.next() {
last = Some(unsafe {
core::mem::transmute::<
Lend<'_, Self>,
Lend<'call, Self>
>(x)
});
}
last
}
#[inline]
fn advance_by(&mut self, n: usize) -> Result<(), NonZeroUsize> {
for i in 0..n {
if self.next().is_none() {
return Err(unsafe { NonZeroUsize::new_unchecked(n - i) });
}
}
Ok(())
}
#[inline]
fn nth(&mut self, n: usize) -> Option<Lend<'_, Self>> {
self.advance_by(n).ok()?;
self.next()
}
#[inline(always)]
fn step_by(self, step: usize) -> StepBy<Self>
where
Self: Sized,
{
StepBy::new(self, step)
}
#[inline(always)]
fn chain<U>(self, other: U) -> Chain<Self, <U as IntoLender>::Lender>
where
Self: Sized,
for<'all> U: IntoLender + Lending<'all, Lend = Lend<'all, Self>>,
{
let other = other.into_lender();
Chain::new(self, other)
}
#[inline(always)]
fn zip<U: IntoLender>(self, other: U) -> Zip<Self, <U as IntoLender>::Lender>
where
Self: Sized,
{
let other = other.into_lender();
Zip::new(self, other)
}
#[inline(always)]
fn intersperse<'call>(self, separator: Lend<'call, Self>) -> Intersperse<'call, Self>
where
Self: Sized,
for<'all> Lend<'all, Self>: Clone,
{
Intersperse::new(self, separator)
}
#[inline(always)]
fn intersperse_with<'call, G>(self, separator: G) -> IntersperseWith<'call, Self, G>
where
Self: Sized,
G: FnMut() -> Lend<'call, Self>,
{
IntersperseWith::new(self, separator)
}
#[inline(always)]
fn map<F>(self, f: Covar<F>) -> Map<Self, F>
where
Self: Sized,
F: for<'all> FnMutHKA<'all, Lend<'all, Self>>,
{
Map::new(self, f)
}
#[inline(always)]
fn map_into_iter<O, F: FnMut(Lend<'_, Self>) -> O>(self, f: F) -> MapIntoIter<Self, O, F>
where Self: Sized
{
MapIntoIter::new(self, f)
}
#[inline(always)]
fn for_each<F>(self, mut f: F)
where
Self: Sized,
F: FnMut(Lend<'_, Self>),
{
self.fold((), |_, t| f(t))
}
#[inline(always)]
fn filter<P>(self, predicate: P) -> Filter<Self, P>
where
Self: Sized,
P: FnMut(&Lend<'_, Self>) -> bool,
{
Filter::new(self, predicate)
}
#[inline(always)]
fn filter_map<F>(self, f: Covar<F>) -> FilterMap<Self, F>
where
Self: Sized,
F: for<'all> FnMutHKAOpt<'all, Lend<'all, Self>>,
{
FilterMap::new(self, f)
}
#[inline(always)]
fn enumerate(self) -> Enumerate<Self>
where
Self: Sized,
{
Enumerate::new(self)
}
#[inline(always)]
fn peekable<'call>(self) -> Peekable<'call, Self>
where
Self: Sized,
{
Peekable::new(self)
}
#[inline(always)]
fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
where
Self: Sized,
P: FnMut(&Lend<'_, Self>) -> bool,
{
SkipWhile::new(self, predicate)
}
#[inline(always)]
fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
where
Self: Sized,
P: FnMut(&Lend<'_, Self>) -> bool,
{
TakeWhile::new(self, predicate)
}
#[inline(always)]
fn map_while<P>(self, predicate: Covar<P>) -> MapWhile<Self, P>
where
Self: Sized,
P: for<'all> FnMutHKAOpt<'all, Lend<'all, Self>>,
{
MapWhile::new(self, predicate)
}
#[inline(always)]
fn skip(self, n: usize) -> Skip<Self>
where
Self: Sized,
{
Skip::new(self, n)
}
#[inline(always)]
fn take(self, n: usize) -> Take<Self>
where
Self: Sized,
{
Take::new(self, n)
}
#[inline(always)]
fn scan<St, F>(self, initial_state: St, f: Covar<F>) -> Scan<Self, St, F>
where
Self: Sized,
F: for<'all> FnMutHKAOpt<'all, (&'all mut St, Lend<'all, Self>)>,
{
Scan::new(self, initial_state, f)
}
#[inline(always)]
fn flat_map<'call, F>(self, f: Covar<F>) -> FlatMap<'call, Self, F>
where
Self: Sized,
F: for<'all> FnMutHKA<'all, Lend<'all, Self>>,
for<'all> <F as FnMutHKA<'all, Lend<'all, Self>>>::B: IntoLender,
{
FlatMap::new(self, f)
}
#[inline(always)]
fn flatten<'call>(self) -> Flatten<'call, Self>
where
Self: Sized,
for<'all> Lend<'all, Self>: IntoLender,
{
Flatten::new(self)
}
#[inline(always)]
fn fuse(self) -> Fuse<Self>
where
Self: Sized,
{
Fuse::new(self)
}
#[inline(always)]
fn inspect<F>(self, f: F) -> Inspect<Self, F>
where
Self: Sized,
F: FnMut(&Lend<'_, Self>),
{
Inspect::new(self, f)
}
#[inline(always)]
fn mutate<F>(self, f: F) -> Mutate<Self, F>
where
Self: Sized,
F: FnMut(&mut Lend<'_, Self>),
{
Mutate::new(self, f)
}
#[inline(always)]
fn by_ref(&mut self) -> &mut Self
where
Self: Sized,
{
self
}
#[inline(always)]
fn collect<B>(self) -> B
where
Self: Sized,
B: FromLender<Self>,
{
B::from_lender(self)
}
#[inline(always)]
fn try_collect<'a, B>(&'a mut self) -> ChangeOutputType<Lend<'a, Self>, B>
where
Self: Sized,
for<'all> Lend<'all, Self>: Try,
for<'all> <Lend<'all, Self> as Try>::Residual: Residual<B>,
for<'all> B: FromLender<TryShunt<'all, &'a mut Self>>,
{
try_process::<&'a mut Self, _, B>(self.by_ref(), |shunt: TryShunt<'_, &'a mut Self>| B::from_lender(shunt))
}
#[inline]
fn collect_into<E>(self, collection: &mut E) -> &mut E
where
Self: Sized,
E: ExtendLender<Self>,
{
collection.extend_lender(self);
collection
}
#[inline]
fn partition<E, F>(mut self, mut f: F) -> (E, E)
where
Self: Sized,
E: Default + ExtendLender<Self>,
F: FnMut(&Lend<'_, Self>) -> bool,
{
let mut left = E::default();
let mut right = E::default();
while let Some(x) = self.next() {
if f(&x) {
left.extend_lender_one(x);
} else {
right.extend_lender_one(x);
}
}
(left, right)
}
#[inline]
#[allow(clippy::wrong_self_convention)]
fn is_partitioned<P>(mut self, mut predicate: P) -> bool
where
Self: Sized,
P: FnMut(Lend<'_, Self>) -> bool,
{
self.all(&mut predicate) || !self.any(predicate)
}
#[inline]
fn try_fold<B, F, R>(&mut self, init: B, mut f: F) -> R
where
F: FnMut(B, Lend<'_, Self>) -> R,
R: Try<Output = B>,
{
let mut acc = init;
while let Some(x) = self.next() {
acc = match f(acc, x).branch() {
ControlFlow::Break(x) => return R::from_residual(x),
ControlFlow::Continue(x) => x,
};
}
R::from_output(acc)
}
#[inline(always)]
fn try_for_each<F, R>(&mut self, mut f: F) -> R
where
F: FnMut(Lend<'_, Self>) -> R,
R: Try<Output = ()>,
{
self.try_fold((), move |(), x| f(x))
}
#[inline]
fn fold<B, F>(mut self, init: B, mut f: F) -> B
where
Self: Sized,
F: FnMut(B, Lend<'_, Self>) -> B,
{
self.try_fold(init, |acc, x| NeverShortCircuit(f(acc, x))).0
}
#[inline]
fn reduce<T, F>(mut self, f: F) -> Option<T>
where
Self: Sized,
for<'all> Lend<'all, Self>: ToOwned<Owned = T>,
F: FnMut(T, Lend<'_, Self>) -> T,
{
let first = self.next()?.to_owned();
Some(self.fold(first, f))
}
#[inline]
fn try_reduce<T, F, R>(mut self, f: F) -> ChangeOutputType<R, Option<T>>
where
Self: Sized,
for<'all> Lend<'all, Self>: ToOwned<Owned = T>,
F: FnMut(T, Lend<'_, Self>) -> R,
R: Try<Output = T>,
R::Residual: Residual<Option<T>>,
{
let first = match self.next() {
Some(ref x) => x.to_owned(),
None => return Try::from_output(None),
};
match self.try_fold(first, f).branch() {
ControlFlow::Break(x) => FromResidual::from_residual(x),
ControlFlow::Continue(x) => Try::from_output(Some(x)),
}
}
#[inline]
fn all<F>(&mut self, mut f: F) -> bool
where
F: FnMut(Lend<'_, Self>) -> bool,
{
while let Some(x) = self.next() {
if !f(x) {
return false;
}
}
true
}
#[inline]
fn any<F>(&mut self, mut f: F) -> bool
where
F: FnMut(Lend<'_, Self>) -> bool,
{
while let Some(x) = self.next() {
if f(x) {
return true;
}
}
false
}
#[inline]
fn find<P>(&mut self, mut predicate: P) -> Option<Lend<'_, Self>>
where
Self: Sized,
P: FnMut(&Lend<'_, Self>) -> bool,
{
while let Some(x) = self.next() {
if predicate(&x) {
return Some(unsafe {
core::mem::transmute::<
Lend<'_, Self>,
Lend<'_, Self>
>(x)
});
}
}
None
}
#[inline]
fn find_map<'a, F>(&'a mut self, mut f: F) -> Option<<F as FnMutHKAOpt<'a, Lend<'a, Self>>>::B>
where
Self: Sized,
F: for<'all> FnMutHKAOpt<'all, Lend<'all, Self>>,
{
while let Some(x) = self.next() {
if let Some(y) = f(x) {
return Some(unsafe {
core::mem::transmute::<
<F as FnMutHKAOpt<'_, Lend<'_, Self>>>::B,
<F as FnMutHKAOpt<'a, Lend<'a, Self>>>::B
>(y)
});
}
}
None
}
#[inline]
fn try_find<F, R>(&mut self, mut f: F) -> ChangeOutputType<R, Option<Lend<'_, Self>>>
where
Self: Sized,
F: FnMut(&Lend<'_, Self>) -> R,
R: Try<Output = bool>,
for<'all> R::Residual: Residual<Option<Lend<'all, Self>>>,
{
while let Some(x) = self.next() {
match f(&x).branch() {
ControlFlow::Break(x) => return <ChangeOutputType<R, Option<Lend<'_, Self>>>>::from_residual(x),
ControlFlow::Continue(cond) => {
if cond {
return <ChangeOutputType<R, Option<Lend<'_, Self>>>>::from_output(
Some(unsafe {
core::mem::transmute::<
Lend<'_, Self>,
Lend<'_, Self>
>(x)
})
);
}
}
}
}
<ChangeOutputType<R, Option<Lend<'_, Self>>>>::from_output(None)
}
#[inline]
fn position<P>(&mut self, mut predicate: P) -> Option<usize>
where
Self: Sized,
P: FnMut(Lend<'_, Self>) -> bool,
{
let mut i = 0;
while let Some(x) = self.next() {
if predicate(x) {
return Some(i);
}
i += 1;
}
None
}
#[inline]
fn rposition<P>(&mut self, mut predicate: P) -> Option<usize>
where
P: FnMut(Lend<'_, Self>) -> bool,
Self: Sized + ExactSizeLender + DoubleEndedLender,
{
match self.try_rfold(self.len(), |i, x| {
let i = i - 1;
if predicate(x) { ControlFlow::Break(i) } else { ControlFlow::Continue(i) }
}) {
ControlFlow::Continue(_) => None,
ControlFlow::Break(x) => Some(x),
}
}
#[inline(always)]
fn max<T: Ord>(self) -> Option<T>
where
Self: Sized,
for<'all> Lend<'all, Self>: ToOwned<Owned = T>,
{
self.owned().max()
}
#[inline(always)]
fn min<T: Ord>(self) -> Option<T>
where
Self: Sized,
for<'all> Lend<'all, Self>: ToOwned<Owned = T>,
{
self.owned().min()
}
#[inline(always)]
fn max_by_key<B: Ord, T, F>(self, f: F) -> Option<T>
where
Self: Sized,
for<'all> Lend<'all, Self>: ToOwned<Owned = T>,
F: FnMut(&T) -> B,
{
self.owned().max_by_key::<B, F>(f)
}
#[inline(always)]
fn max_by<T, F>(self, mut compare: F) -> Option<T>
where
Self: Sized,
for<'all> Lend<'all, Self>: ToOwned<Owned = T>,
F: FnMut(&T, &Lend<'_, Self>) -> Ordering,
{
self.reduce(move |x, y| {
match compare(&x, &y) {
Ordering::Greater => x,
_ => y.to_owned(),
}
})
}
#[inline(always)]
fn min_by_key<B: Ord, T, F>(self, f: F) -> Option<T>
where
Self: Sized,
for<'all> Lend<'all, Self>: ToOwned<Owned = T>,
F: FnMut(&T) -> B,
{
self.owned().min_by_key::<B, F>(f)
}
#[inline(always)]
fn min_by<T, F>(self, mut compare: F) -> Option<T>
where
Self: Sized,
for<'all> Lend<'all, Self>: ToOwned<Owned = T>,
F: FnMut(&T, &Lend<'_, Self>) -> Ordering,
{
self.reduce(move |x, y| {
match compare(&x, &y) {
Ordering::Greater => y.to_owned(),
_ => x,
}
})
}
#[inline(always)]
fn rev(self) -> Rev<Self>
where
Self: Sized + DoubleEndedLender,
{
Rev::new(self)
}
#[inline(always)]
fn unzip<ExtA, ExtB>(self) -> (ExtA, ExtB)
where
Self: Sized,
for<'all> Lend<'all, Self>: TupleLend<'all>,
ExtA: Default + ExtendLender<FirstShunt<Self>>,
ExtB: Default + ExtendLender<SecondShunt<Self>>, {
unzip(self)
}
#[inline(always)]
fn copied<T>(self) -> Copied<Self>
where
Self: Sized + for<'all> Lending<'all, Lend = &'all T>,
T: Copy,
{
Copied::new(self)
}
#[inline(always)]
fn cloned<T>(self) -> Cloned<Self>
where
Self: Sized + for<'all> Lending<'all, Lend = &'all T>,
T: Clone,
{
Cloned::new(self)
}
#[inline(always)]
fn owned(self) -> Owned<Self>
where
Self: Sized,
for<'all> Lend<'all, Self>: ToOwned
{
Owned::new(self)
}
#[inline(always)]
fn cycle(self) -> Cycle<Self>
where
Self: Sized + Clone,
{
Cycle::new(self)
}
#[inline(always)]
fn sum<S>(self) -> S
where
Self: Sized,
S: SumLender<Self>,
{
S::sum_lender(self)
}
#[inline(always)]
fn product<P>(self) -> P
where
Self: Sized,
P: ProductLender<Self>,
{
P::product_lender(self)
}
#[inline(always)]
fn cmp<L>(self, other: L) -> Ordering
where
L: IntoLender,
L::Lender: for<'all> Lending<'all, Lend = Lend<'all, Self>>,
for <'all> Lend<'all, Self>: Ord,
Self: Sized,
{
self.cmp_by(other, |x, y| x.cmp(&y))
}
#[inline]
fn cmp_by<L, F>(self, other: L, mut cmp: F) -> Ordering
where
Self: Sized,
L: IntoLender,
F: for<'all> FnMut(Lend<'all, Self>, Lend<'all, L::Lender>) -> Ordering,
{
match lender_compare(self, other.into_lender(), move |x, y| match cmp(x, y) {
Ordering::Equal => ControlFlow::Continue(()),
neq => ControlFlow::Break(neq),
}) {
ControlFlow::Continue(ord) => ord,
ControlFlow::Break(ord) => ord,
}
}
#[inline(always)]
fn partial_cmp<L>(self, other: L) -> Option<Ordering>
where
L: IntoLender,
for<'all> Lend<'all, Self>: PartialOrd<Lend<'all, L::Lender>>,
Self: Sized,
{
self.partial_cmp_by(other, |x, y| x.partial_cmp(&y))
}
#[inline]
fn partial_cmp_by<L, F>(self, other: L, mut partial_cmp: F) -> Option<Ordering>
where
Self: Sized,
L: IntoLender,
F: for<'all> FnMut(Lend<'all, Self>, Lend<'all, L::Lender>) -> Option<Ordering>,
{
match lender_compare(self, other.into_lender(), move |x, y| match partial_cmp(x, y) {
Some(Ordering::Equal) => ControlFlow::Continue(()),
neq => ControlFlow::Break(neq),
}) {
ControlFlow::Continue(ord) => Some(ord),
ControlFlow::Break(ord) => ord,
}
}
#[inline(always)]
fn eq<L>(self, other: L) -> bool
where
L: IntoLender,
for<'all> Lend<'all, Self>: PartialEq<Lend<'all, L::Lender>>,
Self: Sized,
{
self.eq_by(other, |x, y| x == y)
}
#[inline]
fn eq_by<L, F>(self, other: L, mut eq: F) -> bool
where
Self: Sized,
L: IntoLender,
F: for<'all> FnMut(Lend<'all, Self>, Lend<'all, L::Lender>) -> bool,
{
match lender_compare(self, other.into_lender(), move |x, y| {
if eq(x, y) { ControlFlow::Continue(()) } else { ControlFlow::Break(()) }
}) {
ControlFlow::Continue(ord) => ord == Ordering::Equal,
ControlFlow::Break(()) => false,
}
}
#[inline(always)]
fn ne<L>(self, other: L) -> bool
where
L: IntoLender,
for<'all> Lend<'all, Self>: PartialEq<Lend<'all, L::Lender>>,
Self: Sized,
{
!self.eq(other)
}
#[inline(always)]
fn lt<L>(self, other: L) -> bool
where
L: IntoLender,
for<'all> Lend<'all, Self>: PartialOrd<Lend<'all, L::Lender>>,
Self: Sized,
{
self.partial_cmp(other) == Some(Ordering::Less)
}
#[inline(always)]
fn le<L>(self, other: L) -> bool
where
L: IntoLender,
for<'all> Lend<'all, Self>: PartialOrd<Lend<'all, L::Lender>>,
Self: Sized,
{
matches!(self.partial_cmp(other), Some(Ordering::Less | Ordering::Equal))
}
#[inline(always)]
fn gt<L>(self, other: L) -> bool
where
L: IntoLender,
for<'all> Lend<'all, Self>: PartialOrd<Lend<'all, L::Lender>>,
Self: Sized,
{
self.partial_cmp(other) == Some(Ordering::Greater)
}
#[inline(always)]
fn ge<L>(self, other: L) -> bool
where
L: IntoLender,
for<'all> Lend<'all, Self>: PartialOrd<Lend<'all, L::Lender>>,
Self: Sized,
{
matches!(self.partial_cmp(other), Some(Ordering::Greater | Ordering::Equal))
}
#[inline(always)]
#[allow(clippy::wrong_self_convention)]
fn is_sorted<T>(self) -> bool
where
Self: Sized,
for<'all> Lend<'all, Self>: ToOwned<Owned = T>,
T: PartialOrd,
{
self.is_sorted_by(PartialOrd::partial_cmp)
}
#[inline]
#[allow(clippy::wrong_self_convention)]
fn is_sorted_by<T, F>(self, mut compare: F) -> bool
where
Self: Sized,
for<'all> Lend<'all, Self>: ToOwned<Owned = T>,
F: FnMut(&T, &T) -> Option<Ordering>,
{
let mut this = self.owned();
let Some(mut last) = this.next() else {
return true;
};
this.all(move |curr| {
if let Some(Ordering::Greater) | None = compare(&last, &curr) {
return false;
}
last = curr;
true
})
}
#[inline]
#[allow(clippy::wrong_self_convention)]
fn is_sorted_by_key<F, K>(mut self, mut f: F) -> bool
where
Self: Sized,
F: FnMut(Lend<'_, Self>) -> K,
K: PartialOrd,
{
let mut last = match self.next() {
None => return true,
Some(x) => f(x),
};
while let Some(x) = self.next() {
let curr = f(x);
if let Some(Ordering::Greater) | None = last.partial_cmp(&curr) {
return false;
}
last = curr;
}
true
}
#[inline(always)]
fn iter<'this>(self) -> Iter<'this, Self>
where
Self: Sized + 'this,
for<'all> Lend<'all, Self>: 'this,
{
Iter::new(self)
}
#[inline(always)]
fn lender_by_ref<'this>(self) -> FromIterRef<Iter<'this, Self>>
where
Self: Sized + 'this,
for<'all> Lend<'all, Self>: 'this,
{
crate::from_iter_ref(self.iter())
}
#[inline(always)]
fn chunky(self, chunk_size: usize) -> Chunky<Self>
where
Self: Sized + ExactSizeLender,
{
Chunky::new(self, chunk_size)
}
#[inline(always)]
fn convert<E>(self) -> Convert<E, Self>
where
Self: Sized,
{
Convert::new(self)
}
#[inline(always)]
fn into_fallible(self) -> IntoFallible<Self> where Self: Sized {
IntoFallible::new(self)
}
}
#[inline]
pub(crate) fn lender_compare<A, B, F, T>(mut a: A, mut b: B, mut f: F) -> ControlFlow<T, Ordering>
where
A: Lender,
B: Lender,
for<'all> F: FnMut(Lend<'all, A>, Lend<'all, B>) -> ControlFlow<T>,
{
let mut ctl = ControlFlow::Continue(());
while let Some(x) = a.next() {
match b.next() {
None => {
ctl = ControlFlow::Break(ControlFlow::Continue(Ordering::Greater));
break;
}
Some(y) => {
if let ControlFlow::Break(x) = f(x, y) {
ctl = ControlFlow::Break(ControlFlow::Break(x));
break;
}
}
}
}
match ctl {
ControlFlow::Continue(()) => ControlFlow::Continue(match b.next() {
None => Ordering::Equal,
Some(_) => Ordering::Less,
}),
ControlFlow::Break(x) => x,
}
}
impl<'lend, L: Lender> Lending<'lend> for &mut L {
type Lend = Lend<'lend, L>;
}
impl<L: Lender> Lender for &mut L {
crate::unsafe_assume_covariance!();
#[inline(always)]
fn next(&mut self) -> Option<Lend<'_, Self>> {
(**self).next()
}
#[inline(always)]
fn size_hint(&self) -> (usize, Option<usize>) {
(**self).size_hint()
}
#[inline(always)]
fn advance_by(&mut self, n: usize) -> Result<(), NonZeroUsize> {
(**self).advance_by(n)
}
}