fn hex_digits(n: u8) -> impl Fn(&str) -> IResult<&str, char> {
    move |i: &str| {
        map_opt(
            recognize(count(
                satisfy(|c| c < u8::MAX as char && is_hex_digit(c as u8)),
                n as usize,
            )),
            |out: &str| {
                u32::from_str_radix(out, 16)
                    .ok()
                    .and_then(|u| char::from_u32(u))
            },
        )(i)
    }
}
// A specific number of hex digits turned parsed into a char
A specific number of hex digits turned parsed into a char
A specific number of hex digits turned parsed into a char
fn hex_digits(n: u8) -> impl Fn(&str) -> IResult<&str, char> {
    move |i: &str| {
        map_opt(
            recognize(count(
                satisfy(|c| c < u8::MAX as char && is_hex_digit(c as u8)),
                n as usize,
            )),
            |out: &str| {
                u32::from_str_radix(out, 16)
                    .ok()
                    .and_then(|u| char::from_u32(u))
            },
        )(i)
    }
}
fn hex_digits ( n : u8 ) -> impl Fn ( & str ) -> IResult < & str , char > { move | i : & str | { map_opt ( recognize ( count ( satisfy ( | c | c < u8 :: MAX as char && is_hex_digit ( c as u8 ) ) , n as usize , ) ) , | out : & str | { u32 :: from_str_radix ( out , 16 ) . ok ( ) . and_then ( | u | char :: from_u32 ( u ) ) } , ) ( i ) } }
A specific number of hex digits turned parsed into a char
A specific number of hex digits turned parsed into a char
n
u8
n
u8