Skip to content

Commit 1f4ee20

Browse files
committed
Tweak pretty printing.
1 parent 01615b0 commit 1f4ee20

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/libsyntax/ast_util.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,7 @@ pub fn is_path(e: P<Expr>) -> bool {
141141
/// We want to avoid "45int" and "-3int" in favor of "45" and "-3"
142142
pub fn int_ty_to_string(t: IntTy, val: Option<i64>) -> String {
143143
let s = match t {
144-
TyIs(true) if val.is_some() => "i",
145-
TyIs(true) => "int",
146-
TyIs(false) if val.is_some() => "is",
147-
TyIs(false) => "isize",
144+
TyIs(_) => "isize",
148145
TyI8 => "i8",
149146
TyI16 => "i16",
150147
TyI32 => "i32",
@@ -173,10 +170,7 @@ pub fn int_ty_max(t: IntTy) -> u64 {
173170
/// We want to avoid "42u" in favor of "42us". "42uint" is right out.
174171
pub fn uint_ty_to_string(t: UintTy, val: Option<u64>) -> String {
175172
let s = match t {
176-
TyUs(true) if val.is_some() => "u",
177-
TyUs(true) => "uint",
178-
TyUs(false) if val.is_some() => "us",
179-
TyUs(false) => "usize",
173+
TyUs(_) => "usize",
180174
TyU8 => "u8",
181175
TyU16 => "u16",
182176
TyU32 => "u32",

0 commit comments

Comments
 (0)