diff options
author | Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> | 2023-03-04 15:24:39 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-04 15:24:39 +0530 |
commit | e700d0237408f2fea23771407315ed45ab418aa8 (patch) | |
tree | 90d2518739bc4f0e5da8e086f5168fc57e067081 | |
parent | 2fc4935cdbb53df78fa902c61d3cf722d077adec (diff) | |
parent | e248d0c8373d960187c92f7e5a7557410036e77d (diff) | |
download | rust-e700d0237408f2fea23771407315ed45ab418aa8.tar.gz |
Rollup merge of #108660 - xfix:remove-ne-method-from-str, r=thomcc
Remove ne implementations from strings
As far as I can tell, there isn't really a reason for those.
-rw-r--r-- | library/alloc/src/string.rs | 4 | ||||
-rw-r--r-- | library/core/src/str/traits.rs | 4 |
2 files changed, 0 insertions, 8 deletions
diff --git a/library/alloc/src/string.rs b/library/alloc/src/string.rs index 2b843647dd5..c7e7ed3e95e 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 { diff --git a/library/core/src/str/traits.rs b/library/core/src/str/traits.rs index d3ed811b157..68f62ce8be5 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")] |