Function itertools::equal

source ·
pub fn equal<I, J>(a: I, b: J) -> bool
Expand description

Return true if both iterables produce equal sequences (elements pairwise equal and sequences of the same length), false otherwise.

This is an IntoIterator enabled function that is similar to the standard library method Iterator::eq.

assert!(itertools::equal(vec![1, 2, 3], 1..4));
assert!(!itertools::equal(&[0, 0], &[0, 0, 0]));