orx_imp_vec/common_traits/
eq.rs1use crate::imp_vec::ImpVec;
2use alloc::vec::Vec;
3use orx_fixed_vec::FixedVec;
4use orx_iterable::Collection;
5use orx_pinned_vec::PinnedVec;
6use orx_split_vec::{Growth, SplitVec};
7
8impl<T: PartialEq, P1: PinnedVec<T>, P2: PinnedVec<T>> PartialEq<ImpVec<T, P2>> for ImpVec<T, P1> {
11 fn eq(&self, other: &ImpVec<T, P2>) -> bool {
12 self.len() == other.len() && self.iter().zip(other.iter()).all(|(x, y)| x == y)
13 }
14}
15
16impl<T: PartialEq, P: PinnedVec<T>, G: Growth> PartialEq<ImpVec<T, P>> for SplitVec<T, G> {
19 fn eq(&self, other: &ImpVec<T, P>) -> bool {
20 self.len() == other.len() && self.iter().zip(other.iter()).all(|(x, y)| x == y)
21 }
22}
23
24impl<T: PartialEq, P: PinnedVec<T>, G: Growth> PartialEq<SplitVec<T, G>> for ImpVec<T, P> {
25 fn eq(&self, other: &SplitVec<T, G>) -> bool {
26 self.len() == other.len() && self.iter().zip(other.iter()).all(|(x, y)| x == y)
27 }
28}
29
30impl<T: PartialEq, P: PinnedVec<T>> PartialEq<ImpVec<T, P>> for FixedVec<T> {
33 fn eq(&self, other: &ImpVec<T, P>) -> bool {
34 self.len() == other.len() && self.iter().zip(other.iter()).all(|(x, y)| x == y)
35 }
36}
37
38impl<T: PartialEq, P: PinnedVec<T>> PartialEq<FixedVec<T>> for ImpVec<T, P> {
39 fn eq(&self, other: &FixedVec<T>) -> bool {
40 self.len() == other.len() && self.iter().zip(other.iter()).all(|(x, y)| x == y)
41 }
42}
43
44impl<T: PartialEq, P: PinnedVec<T>> PartialEq<ImpVec<T, P>> for Vec<T> {
47 fn eq(&self, other: &ImpVec<T, P>) -> bool {
48 self.len() == other.len() && self.iter().zip(other.iter()).all(|(x, y)| x == y)
49 }
50}
51
52impl<T: PartialEq, P: PinnedVec<T>> PartialEq<Vec<T>> for ImpVec<T, P> {
53 fn eq(&self, other: &Vec<T>) -> bool {
54 self.len() == other.len() && self.iter().zip(other.iter()).all(|(x, y)| x == y)
55 }
56}
57
58impl<T: PartialEq, P: PinnedVec<T>> PartialEq<ImpVec<T, P>> for [T] {
61 fn eq(&self, other: &ImpVec<T, P>) -> bool {
62 self.len() == other.len() && self.iter().zip(other.iter()).all(|(x, y)| x == y)
63 }
64}
65
66impl<T: PartialEq, P: PinnedVec<T>> PartialEq<[T]> for ImpVec<T, P> {
67 fn eq(&self, other: &[T]) -> bool {
68 self.len() == other.len() && self.iter().zip(other.iter()).all(|(x, y)| x == y)
69 }
70}