Skip to content

Commit 82e1372

Browse files
authored
Rollup merge of rust-lang#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.
2 parents b33d815 + 288b9ca commit 82e1372

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

core/src/char/methods.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ impl char {
6969
/// assert_eq!(char::from_u32(value_at_max + 1), None);
7070
/// ```
7171
#[stable(feature = "assoc_char_consts", since = "1.52.0")]
72-
pub const MAX: char = '\u{10ffff}';
72+
pub const MAX: char = '\u{10FFFF}';
7373

7474
/// `U+FFFD REPLACEMENT CHARACTER` (�) is used in Unicode to represent a
7575
/// decoding error.
@@ -1841,7 +1841,6 @@ pub const fn encode_utf16_raw(mut code: u32, dst: &mut [u16]) -> &mut [u16] {
18411841
}
18421842
(2, [a, b, ..]) => {
18431843
code -= 0x1_0000;
1844-
18451844
*a = (code >> 10) as u16 | 0xD800;
18461845
*b = (code & 0x3FF) as u16 | 0xDC00;
18471846
}

0 commit comments

Comments
 (0)