1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
use crate::imp_vec::ImpVec;
use alloc::vec::Vec;
use orx_fixed_vec::FixedVec;
use orx_pinned_vec::PinnedVec;
use orx_split_vec::{Growth, SplitVec};

// imp

impl<T: PartialEq, P1: PinnedVec<T>, P2: PinnedVec<T>> PartialEq<ImpVec<T, P2>> for ImpVec<T, P1> {
    fn eq(&self, other: &ImpVec<T, P2>) -> bool {
        self.len() == other.len() && self.iter().zip(other.iter()).all(|(x, y)| x == y)
    }
}

// split

impl<T: PartialEq, P: PinnedVec<T>, G: Growth> PartialEq<ImpVec<T, P>> for SplitVec<T, G> {
    fn eq(&self, other: &ImpVec<T, P>) -> bool {
        self.len() == other.len() && self.iter().zip(other.iter()).all(|(x, y)| x == y)
    }
}

impl<T: PartialEq, P: PinnedVec<T>, G: Growth> PartialEq<SplitVec<T, G>> for ImpVec<T, P> {
    fn eq(&self, other: &SplitVec<T, G>) -> bool {
        self.len() == other.len() && self.iter().zip(other.iter()).all(|(x, y)| x == y)
    }
}

// fixed

impl<T: PartialEq, P: PinnedVec<T>> PartialEq<ImpVec<T, P>> for FixedVec<T> {
    fn eq(&self, other: &ImpVec<T, P>) -> bool {
        self.len() == other.len() && self.iter().zip(other.iter()).all(|(x, y)| x == y)
    }
}

impl<T: PartialEq, P: PinnedVec<T>> PartialEq<FixedVec<T>> for ImpVec<T, P> {
    fn eq(&self, other: &FixedVec<T>) -> bool {
        self.len() == other.len() && self.iter().zip(other.iter()).all(|(x, y)| x == y)
    }
}

// vec

impl<T: PartialEq, P: PinnedVec<T>> PartialEq<ImpVec<T, P>> for Vec<T> {
    fn eq(&self, other: &ImpVec<T, P>) -> bool {
        self.len() == other.len() && self.iter().zip(other.iter()).all(|(x, y)| x == y)
    }
}

impl<T: PartialEq, P: PinnedVec<T>> PartialEq<Vec<T>> for ImpVec<T, P> {
    fn eq(&self, other: &Vec<T>) -> bool {
        self.len() == other.len() && self.iter().zip(other.iter()).all(|(x, y)| x == y)
    }
}

// slice

impl<T: PartialEq, P: PinnedVec<T>> PartialEq<ImpVec<T, P>> for [T] {
    fn eq(&self, other: &ImpVec<T, P>) -> bool {
        self.len() == other.len() && self.iter().zip(other.iter()).all(|(x, y)| x == y)
    }
}

impl<T: PartialEq, P: PinnedVec<T>> PartialEq<[T]> for ImpVec<T, P> {
    fn eq(&self, other: &[T]) -> bool {
        self.len() == other.len() && self.iter().zip(other.iter()).all(|(x, y)| x == y)
    }
}