about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-11-28 09:28:36 +0100
committerGitHub <noreply@github.com>2023-11-28 09:28:36 +0100
commit4704d496295beb1d74ca98cabf0b8f16ca584f24 (patch)
tree276b3f6a4483e19376c485999f9e3b4952876539
parent4af1f997400dc0c7bf2d1b931c852e92a40fa15b (diff)
parent1928d82385824810d2aa9b93a3459cf04dbb393a (diff)
downloadrust-4704d496295beb1d74ca98cabf0b8f16ca584f24.tar.gz
rust-4704d496295beb1d74ca98cabf0b8f16ca584f24.zip
Rollup merge of #118236 - ksw2000:update_mod_comment, r=cuviper
Update mod comment

The comment of `ASCII_CASE_MASK` on line 477  is `If 6th bit is set ascii is lower case.` but the original comment of `*self ^ ((self.is_ascii_lowercase() as u8) * ASCII_CASE_MASK)` was `Toggle the fifth bit if this is a lowercase letter`
-rw-r--r--library/core/src/num/mod.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/library/core/src/num/mod.rs b/library/core/src/num/mod.rs
index 2a0b31404f0..695e87aaabf 100644
--- a/library/core/src/num/mod.rs
+++ b/library/core/src/num/mod.rs
@@ -474,7 +474,7 @@ impl isize {
     }
 }
 
-/// If 6th bit is set ascii is lower case.
+/// If the 6th bit is set ascii is lower case.
 const ASCII_CASE_MASK: u8 = 0b0010_0000;
 
 impl u8 {
@@ -549,7 +549,7 @@ impl u8 {
     #[rustc_const_stable(feature = "const_ascii_methods_on_intrinsics", since = "1.52.0")]
     #[inline]
     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)
     }
 
@@ -574,7 +574,7 @@ impl u8 {
     #[rustc_const_stable(feature = "const_ascii_methods_on_intrinsics", since = "1.52.0")]
     #[inline]
     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)
     }