From bc3f6542f39474565f3e7fbe34b9bab45d46789b Mon Sep 17 00:00:00 2001 From: Konrad Borowski Date: Thu, 2 Mar 2023 16:32:04 +0100 Subject: [PATCH 1/2] Remove manual implementation of str::ne --- library/core/src/str/traits.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/library/core/src/str/traits.rs b/library/core/src/str/traits.rs index d3ed811b1575b..68f62ce8be5f6 100644 --- a/library/core/src/str/traits.rs +++ b/library/core/src/str/traits.rs @@ -28,10 +28,6 @@ impl PartialEq for str { fn eq(&self, other: &str) -> bool { self.as_bytes() == other.as_bytes() } - #[inline] - fn ne(&self, other: &str) -> bool { - !(*self).eq(other) - } } #[stable(feature = "rust1", since = "1.0.0")] From e248d0c8373d960187c92f7e5a7557410036e77d Mon Sep 17 00:00:00 2001 From: Konrad Borowski Date: Thu, 2 Mar 2023 16:32:23 +0100 Subject: [PATCH 2/2] Remove manual implementation of String::ne --- library/alloc/src/string.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/library/alloc/src/string.rs b/library/alloc/src/string.rs index 2b843647dd510..c7e7ed3e95e02 100644 --- a/library/alloc/src/string.rs +++ b/library/alloc/src/string.rs @@ -2213,10 +2213,6 @@ impl PartialEq for String { fn eq(&self, other: &String) -> bool { PartialEq::eq(&self[..], &other[..]) } - #[inline] - fn ne(&self, other: &String) -> bool { - PartialEq::ne(&self[..], &other[..]) - } } macro_rules! impl_eq {