@@ -191,19 +191,19 @@ impl<'cx, 'a> Context<'cx, 'a> {
191
191
///
192
192
/// See [Self::manage_initial_capture] and [Self::manage_try_capture]
193
193
fn manage_cond_expr ( & mut self , expr : & mut P < Expr > ) {
194
- match ( * expr) . kind {
195
- ExprKind :: AddrOf ( _, mutability, ref mut local_expr) => {
194
+ match & mut expr. kind {
195
+ ExprKind :: AddrOf ( _, mutability, local_expr) => {
196
196
self . with_is_consumed_management (
197
197
matches ! ( mutability, Mutability :: Mut ) ,
198
198
|this| this. manage_cond_expr ( local_expr)
199
199
) ;
200
200
}
201
- ExprKind :: Array ( ref mut local_exprs) => {
201
+ ExprKind :: Array ( local_exprs) => {
202
202
for local_expr in local_exprs {
203
203
self . manage_cond_expr ( local_expr) ;
204
204
}
205
205
}
206
- ExprKind :: Binary ( ref op, ref mut lhs, ref mut rhs) => {
206
+ ExprKind :: Binary ( op, lhs, rhs) => {
207
207
self . with_is_consumed_management (
208
208
matches ! (
209
209
op. node,
@@ -226,56 +226,56 @@ impl<'cx, 'a> Context<'cx, 'a> {
226
226
}
227
227
) ;
228
228
}
229
- ExprKind :: Call ( _, ref mut local_exprs) => {
229
+ ExprKind :: Call ( _, local_exprs) => {
230
230
for local_expr in local_exprs {
231
231
self . manage_cond_expr ( local_expr) ;
232
232
}
233
233
}
234
- ExprKind :: Cast ( ref mut local_expr, _) => {
234
+ ExprKind :: Cast ( local_expr, _) => {
235
235
self . manage_cond_expr ( local_expr) ;
236
236
}
237
- ExprKind :: Index ( ref mut prefix, ref mut suffix) => {
237
+ ExprKind :: Index ( prefix, suffix) => {
238
238
self . manage_cond_expr ( prefix) ;
239
239
self . manage_cond_expr ( suffix) ;
240
240
}
241
- ExprKind :: MethodCall ( ref mut call) => {
242
- for arg in call. args . iter_mut ( ) {
241
+ ExprKind :: MethodCall ( call) => {
242
+ for arg in & mut call. args {
243
243
self . manage_cond_expr ( arg) ;
244
244
}
245
245
}
246
- ExprKind :: Path ( _, Path { ref segments, .. } ) if let & [ ref path_segment] = & segments[ ..] => {
246
+ ExprKind :: Path ( _, Path { segments, .. } ) if let [ path_segment] = & segments[ ..] => {
247
247
let path_ident = path_segment. ident ;
248
248
self . manage_initial_capture ( expr, path_ident) ;
249
249
}
250
- ExprKind :: Paren ( ref mut local_expr) => {
250
+ ExprKind :: Paren ( local_expr) => {
251
251
self . manage_cond_expr ( local_expr) ;
252
252
}
253
- ExprKind :: Range ( ref mut prefix, ref mut suffix, _) => {
254
- if let Some ( ref mut elem) = prefix {
253
+ ExprKind :: Range ( prefix, suffix, _) => {
254
+ if let Some ( elem) = prefix {
255
255
self . manage_cond_expr ( elem) ;
256
256
}
257
- if let Some ( ref mut elem) = suffix {
257
+ if let Some ( elem) = suffix {
258
258
self . manage_cond_expr ( elem) ;
259
259
}
260
260
}
261
- ExprKind :: Repeat ( ref mut local_expr, ref mut elem) => {
261
+ ExprKind :: Repeat ( local_expr, elem) => {
262
262
self . manage_cond_expr ( local_expr) ;
263
263
self . manage_cond_expr ( & mut elem. value ) ;
264
264
}
265
- ExprKind :: Struct ( ref mut elem) => {
265
+ ExprKind :: Struct ( elem) => {
266
266
for field in & mut elem. fields {
267
267
self . manage_cond_expr ( & mut field. expr ) ;
268
268
}
269
- if let StructRest :: Base ( ref mut local_expr) = elem. rest {
269
+ if let StructRest :: Base ( local_expr) = & mut elem. rest {
270
270
self . manage_cond_expr ( local_expr) ;
271
271
}
272
272
}
273
- ExprKind :: Tup ( ref mut local_exprs) => {
273
+ ExprKind :: Tup ( local_exprs) => {
274
274
for local_expr in local_exprs {
275
275
self . manage_cond_expr ( local_expr) ;
276
276
}
277
277
}
278
- ExprKind :: Unary ( un_op, ref mut local_expr) => {
278
+ ExprKind :: Unary ( un_op, local_expr) => {
279
279
self . with_is_consumed_management (
280
280
matches ! ( un_op, UnOp :: Neg | UnOp :: Not ) ,
281
281
|this| this. manage_cond_expr ( local_expr)
0 commit comments