M7EGDCFHK6P6J5OANSX4MTK7U3Y4ESJ7W5O34ZAKFJNYVEDKG6JQC
trait IterExtra: Iterator {
fn all_eq(&mut self) -> bool
where
<Self as Iterator>::Item: std::cmp::PartialEq,
{
let first = match self.next() {
Some(a) => a,
None => return true,
};
for a in self {
if a != first {
return false;
}
}
true
}
}
impl<I: Iterator> IterExtra for I {}