]> git.lizzy.rs Git - rust.git/commitdiff
Tweak pretty printing.
authorNiko Matsakis <niko@alum.mit.edu>
Tue, 17 Feb 2015 16:25:30 +0000 (11:25 -0500)
committerNiko Matsakis <niko@alum.mit.edu>
Wed, 18 Feb 2015 14:09:13 +0000 (09:09 -0500)
src/libsyntax/ast_util.rs

index b8d4c90f74523fdb48c575dd7b13c0079ed7288b..117507ad8b7e83a3ac77128f8dabe2f0cca894df 100644 (file)
@@ -141,10 +141,7 @@ pub fn is_path(e: P<Expr>) -> bool {
 /// We want to avoid "45int" and "-3int" in favor of "45" and "-3"
 pub fn int_ty_to_string(t: IntTy, val: Option<i64>) -> String {
     let s = match t {
-        TyIs(true) if val.is_some() => "i",
-        TyIs(true) => "int",
-        TyIs(false) if val.is_some() => "is",
-        TyIs(false) => "isize",
+        TyIs(_) => "isize",
         TyI8 => "i8",
         TyI16 => "i16",
         TyI32 => "i32",
@@ -173,10 +170,7 @@ pub fn int_ty_max(t: IntTy) -> u64 {
 /// We want to avoid "42u" in favor of "42us". "42uint" is right out.
 pub fn uint_ty_to_string(t: UintTy, val: Option<u64>) -> String {
     let s = match t {
-        TyUs(true) if val.is_some() => "u",
-        TyUs(true) => "uint",
-        TyUs(false) if val.is_some() => "us",
-        TyUs(false) => "usize",
+        TyUs(_) => "usize",
         TyU8 => "u8",
         TyU16 => "u16",
         TyU32 => "u32",