(length: usize, chars: &mut I)
| 362 | } |
| 363 | |
| 364 | fn parse_unicode_hex<I>(length: usize, chars: &mut I) -> Result<char, ParseUnicodeError> |
| 365 | where |
| 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 | |
| 378 | fn parse_unicode_oct<I>(first_char: &char, chars: &mut I) -> Result<char, ParseUnicodeError> |
| 379 | where |
no test coverage detected