/// Count the sentinels occurring in the text given that the last character is the sentinel.
Count the sentinels occurring in the text given that the last character is the sentinel.
Count the sentinels occurring in the text given that the last character is the sentinel .
fn sentinel_count(text: &[u8]) -> usize {
    let sentinel = sentinel(text);
    assert!(
        text.iter().all(|&a| a >= sentinel),
        "Expecting extra sentinel symbol being lexicographically smallest at the end of the \
         text."
    );
    text.iter()
        .fold(0, |count, &a| count + (a == sentinel) as usize)
}
fn sentinel_count ( text : & [ u8 ] ) -> usize { let sentinel = sentinel ( text ) ; assert ! ( text iter ( ) all ( a a sentinel ) " \
 " ) ; text . iter ( ) . fold ( 0 , | count , & a | count + ( a == sentinel ) as usize ) }
Count the sentinels occurring in the text given that the last character is the sentinel.
Count the sentinels occurring in the text given that the last character is the sentinel .
text
&[u8]