Skip to content

Commit 23d6a6b

Browse files
committed
rustc: Remove unused slice call from extfmt. Closes #532
1 parent 72f90f0 commit 23d6a6b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/comp/front/extfmt.rs

-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ fn expand_syntax_ext(&ext_ctxt cx, common::span sp, &vec[@ast::expr] args,
2929
}
3030
auto parse_fmt_err = bind parse_fmt_err_(cx, fmtspan, _);
3131
auto pieces = parse_fmt_string(fmt, parse_fmt_err);
32-
auto args_len = vec::len[@ast::expr](args);
33-
auto fmt_args = vec::slice[@ast::expr](args, 1u, args_len - 1u);
3432
ret pieces_to_expr(cx, sp, pieces, args);
3533
}
3634

src/test/run-pass/syntax-extension-fmt.rs

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ fn test(str actual, str expected) {
1111
fn main() {
1212
test(#fmt("hello %d friends and %s things", 10, "formatted"),
1313
"hello 10 friends and formatted things");
14+
15+
test(#fmt("test"), "test");
16+
1417
// Simple tests for types
1518

1619
test(#fmt("%d", 1), "1");

0 commit comments

Comments
 (0)