Skip to content

Commit 5061c9f

Browse files
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.
1 parent 04070d1 commit 5061c9f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/libcore/num/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2331,11 +2331,11 @@ impl u8 {
23312331
/// let lowercase_a = 97u8;
23322332
/// let uppercase_a = 65u8;
23332333
///
2334-
/// assert!(lowercase_a.eq_ignore_ascii_case(uppercase_a));
2334+
/// assert!(lowercase_a.eq_ignore_ascii_case(&uppercase_a));
23352335
/// ```
23362336
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
23372337
#[inline]
2338-
pub fn eq_ignore_ascii_case(&self, other: u8) -> bool {
2338+
pub fn eq_ignore_ascii_case(&self, other: &u8) -> bool {
23392339
self.to_ascii_lowercase() == other.to_ascii_lowercase()
23402340
}
23412341

src/libstd/ascii.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ impl AsciiExt for [u8] {
685685
#[inline]
686686
fn eq_ignore_ascii_case(&self, other: &[u8]) -> bool {
687687
self.len() == other.len() &&
688-
self.iter().zip(other).all(|(a, &b)| {
688+
self.iter().zip(other).all(|(a, b)| {
689689
a.eq_ignore_ascii_case(b)
690690
})
691691
}

0 commit comments

Comments
 (0)