about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-10-01 21:09:19 +0200
committerGitHub <noreply@github.com>2024-10-01 21:09:19 +0200
commita5820b47d15baddd2ea9a4579bd290999eb4f02b (patch)
tree03cc343ae043d94fe4faf23ba2b4308bc89a7755
parent97cdc8ef4426c9940bf83f4c283edc09ea6041e5 (diff)
parent5efb3ef2da9348d23c26171dce78ec02fe888653 (diff)
downloadrust-a5820b47d15baddd2ea9a4579bd290999eb4f02b.tar.gz
rust-a5820b47d15baddd2ea9a4579bd290999eb4f02b.zip
Rollup merge of #130773 - bjoernager:master, r=thomcc
Update Unicode escapes in `/library/core/src/char/methods.rs`

`char::MAX` is inconsistent on how Unicode escapes should be formatted. This PR resolves that.
-rw-r--r--library/core/src/char/methods.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/library/core/src/char/methods.rs b/library/core/src/char/methods.rs
index 55e67e5c255..7f3c998aaa5 100644
--- a/library/core/src/char/methods.rs
+++ b/library/core/src/char/methods.rs
@@ -69,7 +69,7 @@ impl char {
     /// assert_eq!(char::from_u32(value_at_max + 1), None);
     /// ```
     #[stable(feature = "assoc_char_consts", since = "1.52.0")]
-    pub const MAX: char = '\u{10ffff}';
+    pub const MAX: char = '\u{10FFFF}';
 
     /// `U+FFFD REPLACEMENT CHARACTER` (�) is used in Unicode to represent a
     /// decoding error.
@@ -1841,7 +1841,6 @@ pub const fn encode_utf16_raw(mut code: u32, dst: &mut [u16]) -> &mut [u16] {
         }
         (2, [a, b, ..]) => {
             code -= 0x1_0000;
-
             *a = (code >> 10) as u16 | 0xD800;
             *b = (code & 0x3FF) as u16 | 0xDC00;
         }