usetraitful::extend;/// Extend the `Iterator` trait with new `all_eq()` method
#[extend(for<I: Iterator> I)]pubtraitIteratorExt: Iterator {/// Return true if all elements of the iterator are equal.
fnall_eq(mutself)->boolwhereSelf::Item: PartialEq,
Self: Sized,
{letSome(first)=self.next()else{returntrue;};self.all(|x|x == first)}}