Skip to content

Commit

Permalink
Fix wrong deref
Browse files Browse the repository at this point in the history
  • Loading branch information
tesuji authored Mar 16, 2020
1 parent ce5e49f commit e1bc9af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libstd/sys_common/wtf8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -600,15 +600,15 @@ 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,
}
}

#[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,
}
}
Expand Down

0 comments on commit e1bc9af

Please sign in to comment.