[−][src]Function conrod_core::utils::iter_diff
pub fn iter_diff<'a, A, B>(a: A, b: B) -> Option<IterDiff<B::Item, B::IntoIter>> where
A: IntoIterator<Item = &'a B::Item>,
B: IntoIterator,
B::Item: PartialEq + 'a,
Compares every element yielded by both elems and new_elems in lock-step.
If the number of elements yielded by b
is less than the number of elements yielded by a
,
the number of b
elements yielded will be returned as IterDiff::Shorter
.
If the two elements of a step differ, the index of those elements along with the remaining
elements are returned as IterDiff::FirstMismatch
.
If a
becomes exhausted before b
becomes exhausted, the remaining b
elements will be
returned as IterDiff::Longer
.
This function is useful when comparing a non-Clone
Iterator
of elements to some existing
collection. If there is any difference between the elements yielded by the iterator and those
of the collection, a suitable IterDiff
is returned so that the existing collection may be
updated with the difference using elements from the very same iterator.