rel/eq.rs
1pub trait PartialEquivalenceRelation<A: ?Sized> {
2 fn equal(&self, &A, &A) -> bool;
3
4 #[inline]
5 fn inequal(&self, x: &A, y: &A) -> bool { !self.equal(x, y) }
6}
7
8pub trait EquivalenceRelation<A: ?Sized> : PartialEquivalenceRelation<A> {}
9
10impl<A: ?Sized + PartialEq> PartialEquivalenceRelation<A> for ::Core {
11 fn equal(&self, x: &A, y: &A) -> bool { x == y }
12 fn inequal(&self, x: &A, y: &A) -> bool { x != y }
13}
14
15impl<A: ?Sized + Eq> EquivalenceRelation<A> for ::Core {}