fn parse_numeric(ident: &str) -> StdResult<BigInt, ParseNumIdentError> {
    use ParseNumIdentError::*;

    if ident.is_empty() || ident.chars().any(|c| !('0'..='9').contains(&c)) {
        Err(InvalidFormat)
    } else if ident.starts_with('0') {
        if ident.len() == 1 {
            Ok(0.into())
        } else {
            Err(AlmostValidFormat)
        }
    } else {
        ident.parse().map_err(|_| OutOfRange)
    }
}
/// Attempts to parse a numeric identifier/literal.
Attempts to parse a numeric identifier/literal.
Attempts to parse a numeric identifier / literal .
fn parse_numeric(ident: &str) -> StdResult<BigInt, ParseNumIdentError> {
    use ParseNumIdentError::*;
    if ident.is_empty() || ident.chars().any(|c| !('0'..='9').contains(&c)) {
        Err(InvalidFormat)
    } else if ident.starts_with('0') {
        if ident.len() == 1 {
            Ok(0.into())
        } else {
            Err(AlmostValidFormat)
        }
    } else {
        ident.parse().map_err(|_| OutOfRange)
    }
}
fn parse_numeric ( ident : & str ) -> StdResult < BigInt , ParseNumIdentError > { use ParseNumIdentError :: * ; if ident . is_empty ( ) || ident . chars ( ) . any ( | c | ! ( '0' ..= '9' ) . contains ( & c ) ) { Err ( InvalidFormat ) } else if ident . starts_with ( '0' ) { if ident . len ( ) == 1 { Ok ( 0 . into ( ) ) } else { Err ( AlmostValidFormat ) } } else { ident . parse ( ) . map_err ( | _ | OutOfRange ) } }
Attempts to parse a numeric identifier/literal.
Attempts to parse a numeric identifier / literal .
ident
&str
ident
&str