diff options
| author | Seo Sanghyeon <sanxiyn@gmail.com> | 2013-05-24 01:09:11 +0900 |
|---|---|---|
| committer | Seo Sanghyeon <sanxiyn@gmail.com> | 2013-05-28 03:14:44 +0900 |
| commit | 8f80323f09ef150efc5cf729100f99981afc96e1 (patch) | |
| tree | 146beb099875fb28ff9eae1d4b5a72b6b624b3c3 /src/libsyntax/ext | |
| parent | 363e67273622285a65caa74bb63ecfa04df59055 (diff) | |
| download | rust-8f80323f09ef150efc5cf729100f99981afc96e1.tar.gz rust-8f80323f09ef150efc5cf729100f99981afc96e1.zip | |
Remove unnecessary allocations flagged by lint
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/asm.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/fmt.rs | 12 | ||||
| -rw-r--r-- | src/libsyntax/ext/pipes/pipec.rs | 10 |
3 files changed, 12 insertions, 12 deletions
diff --git a/src/libsyntax/ext/asm.rs b/src/libsyntax/ext/asm.rs index 204eb9a9f8b..05ac87adcc5 100644 --- a/src/libsyntax/ext/asm.rs +++ b/src/libsyntax/ext/asm.rs @@ -114,7 +114,7 @@ pub fn expand_asm(cx: @ExtCtxt, sp: span, tts: &[ast::token_tree]) p.eat(&token::COMMA); } - let clob = ~"~{" + *p.parse_str() + ~"}"; + let clob = ~"~{" + *p.parse_str() + "}"; clobs.push(clob); } diff --git a/src/libsyntax/ext/fmt.rs b/src/libsyntax/ext/fmt.rs index 987f7fc319a..2efed5780b4 100644 --- a/src/libsyntax/ext/fmt.rs +++ b/src/libsyntax/ext/fmt.rs @@ -158,15 +158,15 @@ fn pieces_to_expr(cx: @ExtCtxt, sp: span, FlagSignAlways => { if !is_signed_type(cnv) { cx.span_fatal(sp, - ~"+ flag only valid in " + - ~"signed fmt! conversion"); + "+ flag only valid in \ + signed fmt! conversion"); } } FlagSpaceForSign => { if !is_signed_type(cnv) { cx.span_fatal(sp, - ~"space flag only valid in " + - ~"signed fmt! conversions"); + "space flag only valid in \ + signed fmt! conversions"); } } FlagLeftZeroPad => (), @@ -284,8 +284,8 @@ fn pieces_to_expr(cx: @ExtCtxt, sp: span, n += 1u; if n >= nargs { cx.span_fatal(sp, - ~"not enough arguments to fmt! " + - ~"for the given format string"); + "not enough arguments to fmt! \ + for the given format string"); } log_conv(conv); diff --git a/src/libsyntax/ext/pipes/pipec.rs b/src/libsyntax/ext/pipes/pipec.rs index 1a7b7e55ace..e55ecbc29bc 100644 --- a/src/libsyntax/ext/pipes/pipec.rs +++ b/src/libsyntax/ext/pipes/pipec.rs @@ -66,7 +66,7 @@ impl gen_send for message { let mut body = ~"{\n"; body += fmt!("use super::%s;\n", name); - body += ~"let mut pipe = pipe;\n"; + body += "let mut pipe = pipe;\n"; if this.proto.is_bounded() { let (sp, rp) = match (this.dir, next.dir) { @@ -76,7 +76,7 @@ impl gen_send for message { (recv, recv) => (~"c", ~"s") }; - body += ~"let mut b = pipe.reuse_buffer();\n"; + body += "let mut b = pipe.reuse_buffer();\n"; body += fmt!("let %s = ::std::pipes::SendPacketBuffered(\ &mut (b.buffer.data.%s));\n", sp, next.name); @@ -103,7 +103,7 @@ impl gen_send for message { if !try { body += fmt!("::std::pipes::send(pipe, message);\n"); // return the new channel - body += ~"c }"; + body += "c }"; } else { body += fmt!("if ::std::pipes::send(pipe, message) {\n \ @@ -152,7 +152,7 @@ impl gen_send for message { } else { ~"(" + str::connect(arg_names.map(|x| copy *x), - ", ") + ~")" + ", ") + ")" }; let mut body = ~"{ "; @@ -161,7 +161,7 @@ impl gen_send for message { if !try { body += fmt!("::std::pipes::send(pipe, message);\n"); - body += ~" }"; + body += " }"; } else { body += fmt!("if ::std::pipes::send(pipe, message) \ { \ |
