#[inline]
fn utf8_acc_cont_byte(ch: u32, byte: u8) -> u32 { (ch << 6) | (byte & CONT_MASK) as u32 }
-/// Checks whether the byte is a UTF-8 continuation byte (i.e. starts with the
+/// Checks whether the byte is a UTF-8 continuation byte (i.e., starts with the
/// bits `10`).
#[inline]
fn utf8_is_cont_byte(byte: u8) -> bool { (byte & !CONT_MASK) == TAG_CONT_U8 }
where I: DoubleEndedIterator<Item = &'a u8>,
{
// Decode UTF-8
- let w = match bytes.next_back() {
- None => return None,
- Some(&next_byte) if next_byte < 128 => return Some(next_byte as u32),
- Some(&back_byte) => back_byte,
+ let w = match *bytes.next_back()? {
+ next_byte if next_byte < 128 => return Some(next_byte as u32),
+ back_byte => back_byte,
};
// Multibyte case follows