spinoso_array/array/smallvec/
eq.rs1use alloc::boxed::Box;
2use alloc::vec::Vec;
3
4use smallvec::SmallVec;
5
6use crate::array::INLINE_CAPACITY;
7use crate::array::smallvec::SmallArray;
8use crate::array::vec::Array;
9
10impl<T, U> PartialEq<SmallVec<[U; INLINE_CAPACITY]>> for SmallArray<T>
11where
12 T: PartialEq<U>,
13{
14 #[inline]
15 fn eq(&self, other: &SmallVec<[U; INLINE_CAPACITY]>) -> bool {
16 self[..] == other[..]
17 }
18}
19
20impl<T, U> PartialEq<SmallArray<U>> for SmallVec<[T; INLINE_CAPACITY]>
21where
22 T: PartialEq<U>,
23{
24 #[inline]
25 fn eq(&self, other: &SmallArray<U>) -> bool {
26 self[..] == other[..]
27 }
28}
29
30impl<T, U> PartialEq<Vec<U>> for SmallArray<T>
31where
32 T: PartialEq<U>,
33{
34 #[inline]
35 fn eq(&self, other: &Vec<U>) -> bool {
36 self[..] == other[..]
37 }
38}
39
40impl<T, U> PartialEq<SmallArray<U>> for Vec<T>
41where
42 T: PartialEq<U>,
43{
44 #[inline]
45 fn eq(&self, other: &SmallArray<U>) -> bool {
46 self[..] == other[..]
47 }
48}
49
50impl<T, U> PartialEq<[U]> for SmallArray<T>
51where
52 T: PartialEq<U>,
53{
54 #[inline]
55 fn eq(&self, other: &[U]) -> bool {
56 self[..] == other[..]
57 }
58}
59
60impl<T, U> PartialEq<SmallArray<U>> for [T]
61where
62 T: PartialEq<U>,
63{
64 #[inline]
65 fn eq(&self, other: &SmallArray<U>) -> bool {
66 self[..] == other[..]
67 }
68}
69
70impl<T, U> PartialEq<Box<[U]>> for SmallArray<T>
71where
72 T: PartialEq<U>,
73{
74 #[inline]
75 fn eq(&self, other: &Box<[U]>) -> bool {
76 self[..] == other[..]
77 }
78}
79
80impl<T, U> PartialEq<SmallArray<U>> for Box<[T]>
81where
82 T: PartialEq<U>,
83{
84 #[inline]
85 fn eq(&self, other: &SmallArray<U>) -> bool {
86 self[..] == other[..]
87 }
88}
89
90impl<T, U> PartialEq<SmallArray<U>> for Array<T>
91where
92 T: PartialEq<U>,
93{
94 #[inline]
95 fn eq(&self, other: &SmallArray<U>) -> bool {
96 self[..] == other[..]
97 }
98}
99
100impl<T, U> PartialEq<Array<U>> for SmallArray<T>
101where
102 T: PartialEq<U>,
103{
104 #[inline]
105 fn eq(&self, other: &Array<U>) -> bool {
106 self[..] == other[..]
107 }
108}
109
110impl<T, U, const N: usize> PartialEq<[U; N]> for SmallArray<T>
111where
112 T: PartialEq<U>,
113{
114 #[inline]
115 fn eq(&self, other: &[U; N]) -> bool {
116 self[..] == other[..]
117 }
118}
119
120impl<T, U, const N: usize> PartialEq<SmallArray<U>> for [T; N]
121where
122 T: PartialEq<U>,
123{
124 #[inline]
125 fn eq(&self, other: &SmallArray<U>) -> bool {
126 self[..] == other[..]
127 }
128}
129
130impl<T, U, const N: usize> PartialEq<&[U; N]> for SmallArray<T>
131where
132 T: PartialEq<U>,
133{
134 #[inline]
135 fn eq(&self, other: &&[U; N]) -> bool {
136 self[..] == other[..]
137 }
138}
139
140impl<T, U, const N: usize> PartialEq<SmallArray<U>> for &[T; N]
141where
142 T: PartialEq<U>,
143{
144 #[inline]
145 fn eq(&self, other: &SmallArray<U>) -> bool {
146 self[..] == other[..]
147 }
148}