Skip to content

Commit 0b8bd6f

Browse files
committed
plugin-guide: nicer creation of the parser
1 parent 37f2db7 commit 0b8bd6f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/doc/guide-plugin.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,7 @@ higher-level syntax elements like expressions:
151151
fn expand_foo(cx: &mut ExtCtxt, sp: Span, args: &[TokenTree])
152152
-> Box<MacResult+'static> {
153153
154-
let mut parser =
155-
parse::new_parser_from_tts(cx.parse_sess(), cx.cfg(), args.to_slice())
154+
let mut parser = cx.new_parser_from_tts(args);
156155
157156
let expr: P<Expr> = parser.parse_expr();
158157
```

0 commit comments

Comments
 (0)