take_last_scalar

Function take_last_scalar 

Source
pub open spec fn take_last_scalar(bytes: Seq<u8>) -> Seq<u8>
Expand description
recommends
valid_utf8(bytes),
bytes.len() > 0,
{
    let len = length_of_last_scalar(bytes);
    bytes.subrange(bytes.len() - len, bytes.len() as int)
}

Takes the bytes corresponding to the last scalar encoded in UTF-8 in the given byte sequence, assuming that the bytes form a valid UTF-8 encoding.