From: lzutao Date: Mon, 16 Mar 2020 16:54:32 +0000 (+0700) Subject: Fix wrong deref X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=e1bc9af9eb503e7ca0027b4d7086c35cd661140e;p=rust.git Fix wrong deref --- 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 @@ fn next_surrogate(&self, mut pos: usize) -> Option<(usize, u16)> { #[inline] fn final_lead_surrogate(&self) -> Option { 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 @@ fn final_lead_surrogate(&self) -> Option { #[inline] fn initial_trail_surrogate(&self) -> Option { match self.bytes { - [0xED, b2 @ 0xB0..=0xBF, b3, ..] => Some(decode_surrogate(*b2, *b3)), + [0xED, b2 @ 0xB0..=0xBF, b3, ..] => Some(decode_surrogate(b2, b3)), _ => None, } }