From fc984cb39435a16f613bfd510f66c78d06a2bd04 Mon Sep 17 00:00:00 2001 From: Alex Saveau Date: Fri, 26 Jul 2024 20:57:05 -0700 Subject: [PATCH] Add PartialEq impls to mirror the stdlib (#358) 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,