impl Parse for UseTree
@@ -984,13 +984,14 @@ pub mod parsing {
vis: input.parse()?,
use_token: input.parse()?,
leading_colon: input.parse()?,
- tree: input.call(use_tree)?,
+ tree: input.parse()?,
semi_token: input.parse()?,
})
}
}
- fn use_tree(input: ParseStream) -> Result<UseTree> {
+ impl Parse for UseTree {
+ fn parse(input: ParseStream) -> Result<UseTree> {
let lookahead = input.lookahead1();
if lookahead.peek(Ident)
|| lookahead.peek(Token![self])
@@ -1003,7 +1004,7 @@ pub mod parsing {
Ok(UseTree::Path(UsePath {
ident: ident,
colon2_token: input.parse()?,
- tree: Box::new(input.call(use_tree)?),
+ tree: Box::new(input.parse()?),
}))
} else if input.peek(Token![as]) {
Ok(UseTree::Rename(UseRename {
@@ -1030,12 +1031,13 @@ pub mod parsing {
let content;
Ok(UseTree::Group(UseGroup {
brace_token: braced!(content in input),
- items: content.parse_terminated(use_tree)?,
+ items: content.parse_terminated(UseTree::parse)?,
}))
} else {
Err(lookahead.error())
}
}
+ }
impl Parse for ItemStatic {
fn parse(input: ParseStream) -> Result<Self> {
