MCPcopy Create free account
hub / github.com/csskit/csskit / decode_non_ascii_at

Method decode_non_ascii_at

crates/css_lexer/src/private.rs:68–72  ·  view source on GitHub ↗

Decode a non-ASCII char starting at `idx`. The byte at `idx` is >= 128.

(&self, idx: usize)

Source from the content-addressed store, hash-verified

66
67 /// Decode a non-ASCII char starting at `idx`. The byte at `idx` is >= 128.
68 fn decode_non_ascii_at(&self, idx: usize) -> char {
69 // SAFETY: self.bytes is valid UTF-8
70 let remaining = unsafe { std::str::from_utf8_unchecked(&self.bytes[idx..]) };
71 remaining.chars().next().unwrap_or(EOF)
72 }
73
74 /// Peek the next two chars
75 #[inline(always)]

Callers 1

peek_char_atMethod · 0.80

Calls 1

nextMethod · 0.45

Tested by

no test coverage detected