diff options
| author | lzutao <taolzu@gmail.com> | 2020-03-16 23:54:32 +0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-16 23:54:32 +0700 |
| commit | e1bc9af9eb503e7ca0027b4d7086c35cd661140e (patch) | |
| tree | f13dac988fd8e2e0cbc920f8a0b053a186ae23e5 /src | |
| parent | ce5e49f86fc8bff241695f8a62e77f517749bd6d (diff) | |
| download | rust-e1bc9af9eb503e7ca0027b4d7086c35cd661140e.tar.gz rust-e1bc9af9eb503e7ca0027b4d7086c35cd661140e.zip | |
Fix wrong deref
Diffstat (limited to 'src')
| -rw-r--r-- | src/libstd/sys_common/wtf8.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/sys_common/wtf8.rs b/src/libstd/sys_common/wtf8.rs index 77977e25517..498950e6821 100644 --- a/src/libstd/sys_common/wtf8.rs +++ b/src/libstd/sys_common/wtf8.rs @@ -600,7 +600,7 @@ impl Wtf8 { #[inline] fn final_lead_surrogate(&self) -> Option<u16> { match self.bytes { - [.., 0xED, b2 @ 0xA0..=0xAF, b3] => Some(decode_surrogate(*b2, *b3)), + [.., 0xED, b2 @ 0xA0..=0xAF, b3] => Some(decode_surrogate(b2, b3)), _ => None, } } @@ -608,7 +608,7 @@ impl Wtf8 { #[inline] fn initial_trail_surrogate(&self) -> Option<u16> { match self.bytes { - [0xED, b2 @ 0xB0..=0xBF, b3, ..] => Some(decode_surrogate(*b2, *b3)), + [0xED, b2 @ 0xB0..=0xBF, b3, ..] => Some(decode_surrogate(b2, b3)), _ => None, } } |
