ir_remote/
are_all_equal.rs

1// https://sts10.github.io/2019/06/06/is-all-equal-function.html
2// https://mastodon.technology/@bugaevc/102226891784062955
3pub trait AreAllEqual {
4    fn are_all_equal(self) -> bool;
5}
6
7impl<T: Eq> AreAllEqual for &[T] {
8    fn are_all_equal(self) -> bool {
9        self.windows(2).all(|w| w[0] == w[1])
10    }
11}