diff options
author | Lukas Kalbertodt <lukas.kalbertodt@gmail.com> | 2017-09-28 16:41:21 +0200 |
---|---|---|
committer | Lukas Kalbertodt <lukas.kalbertodt@gmail.com> | 2017-11-03 21:27:40 +0100 |
commit | 5061c9fecb995bf1920bcb546cd522fe9a84dd3e (patch) | |
tree | cc17aa28b15d328e7181227aba604df33131ca45 | |
parent | 04070d11485463f55edcf9cd37b443ebffe320e8 (diff) | |
download | rust-5061c9fecb995bf1920bcb546cd522fe9a84dd3e.tar.gz |
Revert signature of eq_ignore_ascii_case() to original
Since the methods on u8 directly will shadow the AsciiExt methods,
we cannot change the signature without breaking everything. It
would have been nice to take `u8` as argument instead of `&u8`, but
we cannot break stuff! So this commit reverts it to the original
`&u8` version.
-rw-r--r-- | src/libcore/num/mod.rs | 4 | ||||
-rw-r--r-- | src/libstd/ascii.rs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index 9142b386fe8..a750731e0c9 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -2331,11 +2331,11 @@ impl u8 { /// let lowercase_a = 97u8; /// let uppercase_a = 65u8; /// - /// assert!(lowercase_a.eq_ignore_ascii_case(uppercase_a)); + /// assert!(lowercase_a.eq_ignore_ascii_case(&uppercase_a)); /// ``` #[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")] #[inline] - pub fn eq_ignore_ascii_case(&self, other: u8) -> bool { + pub fn eq_ignore_ascii_case(&self, other: &u8) -> bool { self.to_ascii_lowercase() == other.to_ascii_lowercase() } diff --git a/src/libstd/ascii.rs b/src/libstd/ascii.rs index 8ddc75868ac..327deb9b419 100644 --- a/src/libstd/ascii.rs +++ b/src/libstd/ascii.rs @@ -685,7 +685,7 @@ impl AsciiExt for [u8] { #[inline] fn eq_ignore_ascii_case(&self, other: &[u8]) -> bool { self.len() == other.len() && - self.iter().zip(other).all(|(a, &b)| { + self.iter().zip(other).all(|(a, b)| { a.eq_ignore_ascii_case(b) }) } |