Module itertools::diff

source ·
Expand description

“Diff“ing iterators for caching elements to sequential collections without requiring the new elements’ iterator to be Clone.

  • Diff (produced by the diff_with function) describes the difference between two non-Clone iterators I and J after breaking ASAP from a lock-step comparison.



  • Compares every element yielded by both i and j with the given function in lock-step and returns a Diff which describes how j differs from i.