/// Converts this value into a integer or `None` if is not an integer literal.
Converts this value into a integer or `None` if is not an integer literal.
Converts this value into a integer or ` None ` if is not an integer literal .
pub fn to_integer_literal<N>(&self) -> Option<N>
        where
            N: FromStr,
            N::Err: Display,
    {
        match self {
            Value::Literal(lit) => match lit {
                Lit::Byte(n) => {
                    let s = n.value().to_string();
                    N::from_str(s.as_str()).ok()
                }
                Lit::Int(n) => n.base10_parse().ok(),
                _ => None,
            },
            _ => None,
        }
    }
pub fn to_integer_literal < N > ( & self ) -> Option < N > where N : FromStr , N :: Err : Display , { match self { Value :: Literal ( lit ) => match lit { Lit :: Byte ( n ) => { let s = n . value ( ) . to_string ( ) ; N :: from_str ( s . as_str ( ) ) . ok ( ) } Lit :: Int ( n ) => n . base10_parse ( ) . ok ( ) , _ => None , } , _ => None , } }
Converts this value into a integer or `None` if is not an integer literal.
Converts this value into a integer or ` None ` if is not an integer literal .
&self