diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-05-19 01:07:44 -0400 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-05-20 16:10:40 -0500 |
| commit | 82fa0018c80c8f64cb1b446a7e59492d9ad97b1d (patch) | |
| tree | df9f62eca9ddf44392626a5f22ced00652c08004 /src/libsyntax/parse/token.rs | |
| parent | 074799b4c586c521ba678a4dc3809cad1a872dfe (diff) | |
| download | rust-82fa0018c80c8f64cb1b446a7e59492d9ad97b1d.tar.gz rust-82fa0018c80c8f64cb1b446a7e59492d9ad97b1d.zip | |
Remove all unnecessary allocations (as flagged by lint)
Diffstat (limited to 'src/libsyntax/parse/token.rs')
| -rw-r--r-- | src/libsyntax/parse/token.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index b4bad5abbf9..055336a6d95 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -173,14 +173,14 @@ pub fn to_str(in: @ident_interner, t: &Token) -> ~str { LIT_INT_UNSUFFIXED(i) => { i.to_str() } LIT_FLOAT(s, t) => { let mut body = copy *in.get(s); - if body.ends_with(~".") { + if body.ends_with(".") { body = body + ~"0"; // `10.f` is not a float literal } body + ast_util::float_ty_to_str(t) } LIT_FLOAT_UNSUFFIXED(s) => { let mut body = copy *in.get(s); - if body.ends_with(~".") { + if body.ends_with(".") { body = body + ~"0"; // `10.f` is not a float literal } body |
