| 1 | macro_rules! __impl_slice_eq1 { |
| 2 | ([$($vars:tt)*] $lhs:ty, $rhs:ty, $($constraints:tt)*) => { |
| 3 | #[stable(feature = "vec_deque_partial_eq_slice" , since = "1.17.0" )] |
| 4 | impl<T, U, A: Allocator, $($vars)*> PartialEq<$rhs> for $lhs |
| 5 | where |
| 6 | T: PartialEq<U>, |
| 7 | $($constraints)* |
| 8 | { |
| 9 | fn eq(&self, other: &$rhs) -> bool { |
| 10 | if self.len() != other.len() { |
| 11 | return false; |
| 12 | } |
| 13 | let (sa, sb) = self.as_slices(); |
| 14 | let (oa, ob) = other[..].split_at(sa.len()); |
| 15 | sa == oa && sb == ob |
| 16 | } |
| 17 | } |
| 18 | } |
| 19 | } |
| 20 | |