We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fdbf3fd commit c7deb27Copy full SHA for c7deb27
src/parse.rs
@@ -18,14 +18,12 @@ pub enum Item {
18
impl Parse for Item {
19
fn parse(input: ParseStream) -> Result<Self> {
20
let attrs = input.call(Attribute::parse_outer)?;
21
- let first_lookahead = input.lookahead1();
22
- let lookahead = if first_lookahead.peek(Token![unsafe]) {
+ let mut lookahead = input.lookahead1();
+ if lookahead.peek(Token![unsafe]) {
23
let ahead = input.fork();
24
ahead.parse::<Token![unsafe]>()?;
25
- ahead.lookahead1()
26
- } else {
27
- first_lookahead
28
- };
+ lookahead = ahead.lookahead1();
+ }
29
if lookahead.peek(Token![pub]) || lookahead.peek(Token![trait]) {
30
let mut item: ItemTrait = input.parse()?;
31
item.attrs = attrs;
0 commit comments