Function regex_automata::util::utf8::decode_last
source ยท pub(crate) fn decode_last(bytes: &[u8]) -> Option<Result<char, u8>>
Expand description
Decodes the last UTF-8 encoded codepoint from the given byte slice.
If no valid encoding of a codepoint exists at the end of the given byte slice, then the last byte is returned instead.
This returns None
if and only if bytes
is empty.