Update comment for consistent context logic.
This commit is contained in:
parent
41fe75ec6b
commit
e9f628e109
@ -549,7 +549,7 @@ impl u8 {
|
|||||||
#[rustc_const_stable(feature = "const_ascii_methods_on_intrinsics", since = "1.52.0")]
|
#[rustc_const_stable(feature = "const_ascii_methods_on_intrinsics", since = "1.52.0")]
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn to_ascii_uppercase(&self) -> u8 {
|
pub const fn to_ascii_uppercase(&self) -> u8 {
|
||||||
// Toggle the fifth bit if this is a lowercase letter
|
// Toggle the 6th bit if this is a lowercase letter
|
||||||
*self ^ ((self.is_ascii_lowercase() as u8) * ASCII_CASE_MASK)
|
*self ^ ((self.is_ascii_lowercase() as u8) * ASCII_CASE_MASK)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -574,7 +574,7 @@ impl u8 {
|
|||||||
#[rustc_const_stable(feature = "const_ascii_methods_on_intrinsics", since = "1.52.0")]
|
#[rustc_const_stable(feature = "const_ascii_methods_on_intrinsics", since = "1.52.0")]
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn to_ascii_lowercase(&self) -> u8 {
|
pub const fn to_ascii_lowercase(&self) -> u8 {
|
||||||
// Set the fifth bit if this is an uppercase letter
|
// Set the 6th bit if this is an uppercase letter
|
||||||
*self | (self.is_ascii_uppercase() as u8 * ASCII_CASE_MASK)
|
*self | (self.is_ascii_uppercase() as u8 * ASCII_CASE_MASK)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user