From fa561958073ea7d607e3be4dfde16d7245515e49 Mon Sep 17 00:00:00 2001 From: Alex Saveau Date: Fri, 26 Jul 2024 19:20:41 -0700 Subject: [PATCH] Add PartialEq impls to mirror the stdlib Signed-off-by: Alex Saveau --- src/lib.rs | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index c044c67..4bf7e5a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2020,6 +2020,56 @@ where } impl Eq for SmallVec where T: Eq {} +impl PartialEq<[U; M]> for SmallVec +where + T: PartialEq, +{ + #[inline] + fn eq(&self, other: &[U; M]) -> bool { + self[..] == other[..] + } +} + +impl PartialEq<&[U; M]> for SmallVec +where + T: PartialEq, +{ + #[inline] + fn eq(&self, other: &&[U; M]) -> bool { + self[..] == other[..] + } +} + +impl PartialEq<[U]> for SmallVec +where + T: PartialEq, +{ + #[inline] + fn eq(&self, other: &[U]) -> bool { + self[..] == other[..] + } +} + +impl PartialEq<&[U]> for SmallVec +where + T: PartialEq, +{ + #[inline] + fn eq(&self, other: &&[U]) -> bool { + self[..] == other[..] + } +} + +impl PartialEq<&mut [U]> for SmallVec +where + T: PartialEq, +{ + #[inline] + fn eq(&self, other: &&mut [U]) -> bool { + self[..] == other[..] + } +} + impl PartialOrd for SmallVec where T: PartialOrd,