fn iter_compare<A, B, F, T>(a: A, b: B, f: F) -> ControlFlow<T, Ordering>where
A: Iterator,
B: Iterator,
F: FnMut(A::Item, B::Item) -> ControlFlow<T>,
Expand description
Compares two iterators element-wise using the given function.
If ControlFlow::Continue(())
is returned from the function, the comparison moves on to the next
elements of both iterators. Returning ControlFlow::Break(x)
short-circuits the iteration and
returns ControlFlow::Break(x)
. If one of the iterators runs out of elements,
ControlFlow::Continue(ord)
is returned where ord
is the result of comparing the lengths of
the iterators.
Isolates the logic shared by ‘cmp_by’, ‘partial_cmp_by’, and ‘eq_by’.