spinoso_array/array/vec/
eq.rs

1use alloc::boxed::Box;
2use alloc::vec::Vec;
3
4use crate::array::vec::Array;
5
6impl<T, U> PartialEq<Vec<U>> for Array<T>
7where
8    T: PartialEq<U>,
9{
10    #[inline]
11    fn eq(&self, other: &Vec<U>) -> bool {
12        self[..] == other[..]
13    }
14}
15
16impl<T, U> PartialEq<Array<U>> for Vec<T>
17where
18    T: PartialEq<U>,
19{
20    #[inline]
21    fn eq(&self, other: &Array<U>) -> bool {
22        self[..] == other[..]
23    }
24}
25
26impl<T, U> PartialEq<[U]> for Array<T>
27where
28    T: PartialEq<U>,
29{
30    #[inline]
31    fn eq(&self, other: &[U]) -> bool {
32        self[..] == other[..]
33    }
34}
35
36impl<T, U> PartialEq<Array<U>> for [T]
37where
38    T: PartialEq<U>,
39{
40    #[inline]
41    fn eq(&self, other: &Array<U>) -> bool {
42        self[..] == other[..]
43    }
44}
45
46impl<T, U> PartialEq<Box<[U]>> for Array<T>
47where
48    T: PartialEq<U>,
49{
50    #[inline]
51    fn eq(&self, other: &Box<[U]>) -> bool {
52        self[..] == other[..]
53    }
54}
55
56impl<T, U> PartialEq<Array<U>> for Box<[T]>
57where
58    T: PartialEq<U>,
59{
60    #[inline]
61    fn eq(&self, other: &Array<U>) -> bool {
62        self[..] == other[..]
63    }
64}
65
66impl<T, U, const N: usize> PartialEq<[U; N]> for Array<T>
67where
68    T: PartialEq<U>,
69{
70    #[inline]
71    fn eq(&self, other: &[U; N]) -> bool {
72        self[..] == other[..]
73    }
74}
75
76impl<T, U, const N: usize> PartialEq<Array<U>> for [T; N]
77where
78    T: PartialEq<U>,
79{
80    #[inline]
81    fn eq(&self, other: &Array<U>) -> bool {
82        self[..] == other[..]
83    }
84}
85
86impl<T, U, const N: usize> PartialEq<&[U; N]> for Array<T>
87where
88    T: PartialEq<U>,
89{
90    #[inline]
91    fn eq(&self, other: &&[U; N]) -> bool {
92        self[..] == other[..]
93    }
94}
95
96impl<T, U, const N: usize> PartialEq<Array<U>> for &[T; N]
97where
98    T: PartialEq<U>,
99{
100    #[inline]
101    fn eq(&self, other: &Array<U>) -> bool {
102        self[..] == other[..]
103    }
104}