Skip to content

Commit 47eec97

Browse files
committed
remove unnecessary abstraction
1 parent 977b380 commit 47eec97

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/libsyntax/ext/expand.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -988,35 +988,30 @@ impl Folder for Marker {
988988
}
989989
}
990990

991-
// just a convenience:
992-
fn new_mark_folder(m: Mrk) -> Marker {
993-
Marker {mark: m}
994-
}
995-
996991
// apply a given mark to the given token trees. Used prior to expansion of a macro.
997992
fn mark_tts(tts: &[TokenTree], m: Mrk) -> Vec<TokenTree> {
998-
fold_tts(tts, &mut new_mark_folder(m))
993+
fold_tts(tts, &mut Marker{mark:m})
999994
}
1000995

1001996
// apply a given mark to the given expr. Used following the expansion of a macro.
1002997
fn mark_expr(expr: Gc<ast::Expr>, m: Mrk) -> Gc<ast::Expr> {
1003-
new_mark_folder(m).fold_expr(expr)
998+
Marker{mark:m}.fold_expr(expr)
1004999
}
10051000

10061001
// apply a given mark to the given pattern. Used following the expansion of a macro.
10071002
fn mark_pat(pat: Gc<ast::Pat>, m: Mrk) -> Gc<ast::Pat> {
1008-
new_mark_folder(m).fold_pat(pat)
1003+
Marker{mark:m}.fold_pat(pat)
10091004
}
10101005

10111006
// apply a given mark to the given stmt. Used following the expansion of a macro.
10121007
fn mark_stmt(expr: &ast::Stmt, m: Mrk) -> Gc<ast::Stmt> {
1013-
new_mark_folder(m).fold_stmt(expr)
1008+
Marker{mark:m}.fold_stmt(expr)
10141009
.expect_one("marking a stmt didn't return a stmt")
10151010
}
10161011

10171012
// apply a given mark to the given item. Used following the expansion of a macro.
10181013
fn mark_item(expr: Gc<ast::Item>, m: Mrk) -> SmallVector<Gc<ast::Item>> {
1019-
new_mark_folder(m).fold_item(expr)
1014+
Marker{mark:m}.fold_item(expr)
10201015
}
10211016

10221017
fn original_span(cx: &ExtCtxt) -> Gc<codemap::ExpnInfo> {

0 commit comments

Comments
 (0)