]> git.lizzy.rs Git - rust.git/commitdiff
Fix wrong deref
authorlzutao <taolzu@gmail.com>
Mon, 16 Mar 2020 16:54:32 +0000 (23:54 +0700)
committerGitHub <noreply@github.com>
Mon, 16 Mar 2020 16:54:32 +0000 (23:54 +0700)
src/libstd/sys_common/wtf8.rs

index 77977e255172affdb4879887960ffb59bd506395..498950e68210148756370bf56965385560c2a32e 100644 (file)
@@ -600,7 +600,7 @@ fn next_surrogate(&self, mut pos: usize) -> Option<(usize, u16)> {
     #[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 @@ fn final_lead_surrogate(&self) -> Option<u16> {
     #[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,
         }
     }