diff options
Diffstat (limited to '')
-rw-r--r-- | library/core/src/char/decode.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/library/core/src/char/decode.rs b/library/core/src/char/decode.rs index 11f1c30f6..eeb088030 100644 --- a/library/core/src/char/decode.rs +++ b/library/core/src/char/decode.rs @@ -67,7 +67,7 @@ impl<I: Iterator<Item = u16>> Iterator for DecodeUtf16<I> { } // all ok, so lets decode it. - let c = (((u - 0xD800) as u32) << 10 | (u2 - 0xDC00) as u32) + 0x1_0000; + let c = (((u & 0x3ff) as u32) << 10 | (u2 & 0x3ff) as u32) + 0x1_0000; // SAFETY: we checked that it's a legal unicode value Some(Ok(unsafe { from_u32_unchecked(c) })) } |