fn multibyte_char_range_at_reverse(s: &str, mut i: usize) -> CharRange {
            // while there is a previous byte == 10......
            while i > 0 && s.as_bytes()[i] & !CONT_MASK == TAG_CONT_U8 {
                i -= 1;
            }

            let first= s.as_bytes()[i];
            let w = UTF8_CHAR_WIDTH[first as usize];
            assert!(w != 0);

            let mut val = utf8_first_byte(first, w as u32);
            val = utf8_acc_cont_byte(val, s.as_bytes()[i + 1]);
            if w > 2 { val = utf8_acc_cont_byte(val, s.as_bytes()[i + 2]); }
            if w > 3 { val = utf8_acc_cont_byte(val, s.as_bytes()[i + 3]); }

            return CharRange {ch: unsafe { char::from_u32_unchecked(val) }, next: i};
        }
// Multibyte case is a fn to allow char_range_at_reverse to inline cleanly
Multibyte case is a fn to allow char_range_at_reverse to inline cleanly
Multibyte case is a fn to allow char_range_at_reverse to inline cleanly
fn multibyte_char_range_at_reverse(s: &str, mut i: usize) -> CharRange {
            // while there is a previous byte == 10......
            while i > 0 && s.as_bytes()[i] & !CONT_MASK == TAG_CONT_U8 {
                i -= 1;
            }
            let first= s.as_bytes()[i];
            let w = UTF8_CHAR_WIDTH[first as usize];
            assert!(w != 0);
            let mut val = utf8_first_byte(first, w as u32);
            val = utf8_acc_cont_byte(val, s.as_bytes()[i + 1]);
            if w > 2 { val = utf8_acc_cont_byte(val, s.as_bytes()[i + 2]); }
            if w > 3 { val = utf8_acc_cont_byte(val, s.as_bytes()[i + 3]); }
            return CharRange {ch: unsafe { char::from_u32_unchecked(val) }, next: i};
        }
fn multibyte_char_range_at_reverse ( s : & str , mut i : usize ) -> CharRange { // while there is a previous byte == 10...... while i > 0 && s . as_bytes ( ) [ i ] & ! CONT_MASK == TAG_CONT_U8 { i -= 1 ; } let first = s . as_bytes ( ) [ i ] ; let w = UTF8_CHAR_WIDTH [ first as usize ] ; assert ! ( w 0 ) ; let mut val = utf8_first_byte ( first , w as u32 ) ; val = utf8_acc_cont_byte ( val , s . as_bytes ( ) [ i + 1 ] ) ; if w > 2 { val = utf8_acc_cont_byte ( val , s . as_bytes ( ) [ i + 2 ] ) ; } if w > 3 { val = utf8_acc_cont_byte ( val , s . as_bytes ( ) [ i + 3 ] ) ; } return CharRange { ch : unsafe { char :: from_u32_unchecked ( val ) } , next : i } ; }
Multibyte case is a fn to allow char_range_at_reverse to inline cleanly
Multibyte case is a fn to allow char_range_at_reverse to inline cleanly
s
&str
i
usize
s
&str
i
usize