/// Get a string representation of a signed int type, with its value.
/// We want to avoid "45int" and "-3int" in favor of "45" and "-3"
Get a string representation of a signed int type, with its value.
Get a string representation of a signed int type with its value .
pub fn int_ty_to_string(t: IntTy, val: Option<i64>) -> String {
    let s = match t {
        TyIs => "isize",
        TyI8 => "i8",
        TyI16 => "i16",
        TyI32 => "i32",
        TyI64 => "i64"
    };
    match val {
        // cast to a u64 so we can correctly print INT64_MIN. All integral types
        // are parsed as u64, so we wouldn't want to print an extra negative
        // sign.
        Some(n) => format!("{}{}", n as u64, s),
        None => s.to_string()
    }
}
pub fn int_ty_to_string ( t : IntTy , val : Option < i64 > ) -> String { let s = match t { TyIs => " " , TyI8 => " " , TyI16 => " " , TyI32 => " " , TyI64 => " " } ; match val { // cast to a u64 so we can correctly print INT64_MIN. All integral types // are parsed as u64, so we wouldn't want to print an extra negative // sign. Some ( n ) => format ! ( " " n as u64 s ) , None => s . to_string ( ) } }
Get a string representation of a signed int type, with its value.
Get a string representation of a signed int type with its value .
t
IntTy
val
Option<i64>