We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f4a7ce9 commit 1e6365dCopy full SHA for 1e6365d
library/core/src/num/mod.rs
@@ -299,8 +299,8 @@ impl u8 {
299
#[rustc_const_stable(feature = "const_ascii_methods_on_intrinsics", since = "1.52.0")]
300
#[inline]
301
pub const fn to_ascii_uppercase(&self) -> u8 {
302
- // Unset the fifth bit if this is a lowercase letter
303
- *self & !((self.is_ascii_lowercase() as u8) * ASCII_CASE_MASK)
+ // Toggle the fifth bit if this is a lowercase letter
+ *self ^ ((self.is_ascii_lowercase() as u8) * ASCII_CASE_MASK)
304
}
305
306
/// Makes a copy of the value in its ASCII lower case equivalent.
0 commit comments