fn try_parse_as_hex_number(n: &str) -> Option<Result<i64, ByteOffsetParseError>> {
    use ByteOffsetParseError::*;
    n.strip_prefix(HEX_PREFIX).map(|num| {
        let mut chars = num.chars();
        match chars.next() {
            Some(c @ '+') | Some(c @ '-') => {
                return if chars.next().is_none() {
                    Err(EmptyAfterSign)
                } else {
                    Err(SignFoundAfterHexPrefix(c))
                }
            }
            _ => (),
        }
        i64::from_str_radix(num, 16).map_err(ParseNum)
    })
}
/// If `n` starts with a hex prefix, its remaining part is returned as some number (if possible),
/// otherwise None is returned.
If `n` starts with a hex prefix, its remaining part is returned as some number (if possible),
otherwise None is returned.
If ` n ` starts with a hex prefix its remaining part is returned as some number ( if possible ) otherwise None is returned .
fn try_parse_as_hex_number(n: &str) -> Option<Result<i64, ByteOffsetParseError>> {
    use ByteOffsetParseError::*;
    n.strip_prefix(HEX_PREFIX).map(|num| {
        let mut chars = num.chars();
        match chars.next() {
            Some(c @ '+') | Some(c @ '-') => {
                return if chars.next().is_none() {
                    Err(EmptyAfterSign)
                } else {
                    Err(SignFoundAfterHexPrefix(c))
                }
            }
            _ => (),
        }
        i64::from_str_radix(num, 16).map_err(ParseNum)
    })
}
fn try_parse_as_hex_number ( n : & str ) -> Option < Result < i64 , ByteOffsetParseError > > { use ByteOffsetParseError :: * ; n . strip_prefix ( HEX_PREFIX ) . map ( | num | { let mut chars = num . chars ( ) ; match chars . next ( ) { Some ( c @ '+' ) | Some ( c @ '-' ) => { return if chars . next ( ) . is_none ( ) { Err ( EmptyAfterSign ) } else { Err ( SignFoundAfterHexPrefix ( c ) ) } } _ => ( ) , } i64 :: from_str_radix ( num , 16 ) . map_err ( ParseNum ) } ) }
If `n` starts with a hex prefix, its remaining part is returned as some number (if possible),
otherwise None is returned.
If ` n ` starts with a hex prefix its remaining part is returned as some number ( if possible ) otherwise None is returned .
n
&str