@@ -103,7 +103,7 @@ impl<'a> Parser<'a> {
103
103
// If we captured tokens during parsing (due to outer attributes),
104
104
// use those.
105
105
if item. tokens . is_none ( ) {
106
- item. tokens = Some ( tokens) ;
106
+ item. tokens = tokens;
107
107
}
108
108
token:: NtItem ( item)
109
109
}
@@ -115,7 +115,7 @@ impl<'a> Parser<'a> {
115
115
let ( mut block, tokens) = self . collect_tokens ( |this| this. parse_block ( ) ) ?;
116
116
// We have have eaten an NtBlock, which could already have tokens
117
117
if block. tokens . is_none ( ) {
118
- block. tokens = Some ( tokens) ;
118
+ block. tokens = tokens;
119
119
}
120
120
token:: NtBlock ( block)
121
121
}
@@ -124,7 +124,7 @@ impl<'a> Parser<'a> {
124
124
match stmt {
125
125
Some ( mut s) => {
126
126
if s. tokens . is_none ( ) {
127
- s. tokens = Some ( tokens) ;
127
+ s. tokens = tokens;
128
128
}
129
129
token:: NtStmt ( s)
130
130
}
@@ -137,7 +137,7 @@ impl<'a> Parser<'a> {
137
137
let ( mut pat, tokens) = self . collect_tokens ( |this| this. parse_pat ( None ) ) ?;
138
138
// We have have eaten an NtPat, which could already have tokens
139
139
if pat. tokens . is_none ( ) {
140
- pat. tokens = Some ( tokens) ;
140
+ pat. tokens = tokens;
141
141
}
142
142
token:: NtPat ( pat)
143
143
}
@@ -146,7 +146,7 @@ impl<'a> Parser<'a> {
146
146
// If we captured tokens during parsing (due to outer attributes),
147
147
// use those.
148
148
if expr. tokens . is_none ( ) {
149
- expr. tokens = Some ( tokens) ;
149
+ expr. tokens = tokens;
150
150
}
151
151
token:: NtExpr ( expr)
152
152
}
@@ -155,15 +155,15 @@ impl<'a> Parser<'a> {
155
155
self . collect_tokens ( |this| this. parse_literal_maybe_minus ( ) ) ?;
156
156
// We have have eaten a nonterminal, which could already have tokens
157
157
if lit. tokens . is_none ( ) {
158
- lit. tokens = Some ( tokens) ;
158
+ lit. tokens = tokens;
159
159
}
160
160
token:: NtLiteral ( lit)
161
161
}
162
162
NonterminalKind :: Ty => {
163
163
let ( mut ty, tokens) = self . collect_tokens ( |this| this. parse_ty ( ) ) ?;
164
164
// We have an eaten an NtTy, which could already have tokens
165
165
if ty. tokens . is_none ( ) {
166
- ty. tokens = Some ( tokens) ;
166
+ ty. tokens = tokens;
167
167
}
168
168
token:: NtTy ( ty)
169
169
}
@@ -183,15 +183,15 @@ impl<'a> Parser<'a> {
183
183
self . collect_tokens ( |this| this. parse_path ( PathStyle :: Type ) ) ?;
184
184
// We have have eaten an NtPath, which could already have tokens
185
185
if path. tokens . is_none ( ) {
186
- path. tokens = Some ( tokens) ;
186
+ path. tokens = tokens;
187
187
}
188
188
token:: NtPath ( path)
189
189
}
190
190
NonterminalKind :: Meta => {
191
191
let ( mut attr, tokens) = self . collect_tokens ( |this| this. parse_attr_item ( false ) ) ?;
192
192
// We may have eaten a nonterminal, which could already have tokens
193
193
if attr. tokens . is_none ( ) {
194
- attr. tokens = Some ( tokens) ;
194
+ attr. tokens = tokens;
195
195
}
196
196
token:: NtMeta ( P ( attr) )
197
197
}
@@ -201,7 +201,7 @@ impl<'a> Parser<'a> {
201
201
self . collect_tokens ( |this| this. parse_visibility ( FollowedByType :: Yes ) ) ?;
202
202
// We may have etan an `NtVis`, which could already have tokens
203
203
if vis. tokens . is_none ( ) {
204
- vis. tokens = Some ( tokens) ;
204
+ vis. tokens = tokens;
205
205
}
206
206
token:: NtVis ( vis)
207
207
}
0 commit comments