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

Function codepoint_to_char

crates/css_lexer/src/private.rs:889–896  ·  view source on GitHub ↗
(value: u32)

Source from the content-addressed store, hash-verified

887/// Convert raw codepoint to char, handling 0 and surrogates -> REPLACEMENT_CHARACTER
888#[inline]
889fn codepoint_to_char(value: u32) -> char {
890 use crate::syntax::SURROGATE_RANGE;
891 if value == 0 || SURROGATE_RANGE.contains(&value) {
892 REPLACEMENT_CHARACTER
893 } else {
894 char::from_u32(value).unwrap_or(REPLACEMENT_CHARACTER)
895 }
896}
897
898impl<'a> Lexer<'a> {
899 #[must_use]

Callers 2

parse_escape_sequenceMethod · 0.85
parse_escape_sequenceMethod · 0.85

Calls 1

containsMethod · 0.45

Tested by

no test coverage detected