MCPcopy Create free account
hub / github.com/cel-rust/cel-rust / parse_unicode_hex

Function parse_unicode_hex

cel/src/parser/parse.rs:364–376  ·  view source on GitHub ↗
(length: usize, chars: &mut I)

Source from the content-addressed store, hash-verified

362}
363
364fn parse_unicode_hex<I>(length: usize, chars: &mut I) -> Result<char, ParseUnicodeError>
365where
366 I: Iterator<Item = (usize, char)>,
367{
368 let unicode_seq: String = chars.take(length).map(|(_, c)| c).collect();
369
370 u32::from_str_radix(&unicode_seq, 16)
371 .map_err(|e| ParseUnicodeError::Hex {
372 source: e,
373 string: unicode_seq,
374 })
375 .and_then(|u| char::from_u32(u).ok_or(ParseUnicodeError::Unicode { value: u }))
376}
377
378fn parse_unicode_oct<I>(first_char: &char, chars: &mut I) -> Result<char, ParseUnicodeError>
379where

Callers 1

parse_quoted_stringFunction · 0.85

Calls 1

mapMethod · 0.80

Tested by

no test coverage detected