@@ -263,7 +263,8 @@ impl<'a, 'tcx> VarVisitor<'a, 'tcx> {
263263 match res {
264264 Res :: Local ( hir_id) => {
265265 let parent_def_id = self . cx. tcx. hir( ) . get_parent_item( expr. hir_id) ;
266- let extent = self . cx
266+ let extent = self
267+ . cx
267268 . tcx
268269 . region_scope_tree( parent_def_id)
269270 . var_scope( hir_id. local_id)
@@ -274,11 +275,12 @@ impl<'a, 'tcx> VarVisitor<'a, 'tcx> {
274275 ( Some ( extent) , self . cx. typeck_results( ) . node_type( seqexpr. hir_id) ) ,
275276 ) ;
276277 } else {
277- self . indexed_indirectly. insert( seqvar. segments[ 0 ] . ident. name, Some ( extent) ) ;
278+ self . indexed_indirectly
279+ . insert( seqvar. segments[ 0 ] . ident. name, Some ( extent) ) ;
278280 }
279- return false ; // no need to walk further *on the variable*
280- }
281- Res :: Def ( DefKind :: Static ( _) | DefKind :: Const , ..) => {
281+ return false ; // no need to walk further *on the variable*
282+ } ,
283+ Res :: Def ( DefKind :: Static ( _) | DefKind :: Const , ..) => {
282284 if index_used_directly {
283285 self . indexed_directly. insert(
284286 seqvar. segments[ 0 ] . ident. name,
@@ -287,8 +289,8 @@ impl<'a, 'tcx> VarVisitor<'a, 'tcx> {
287289 } else {
288290 self . indexed_indirectly. insert( seqvar. segments[ 0 ] . ident. name, None ) ;
289291 }
290- return false ; // no need to walk further *on the variable*
291- }
292+ return false ; // no need to walk further *on the variable*
293+ } ,
292294 _ => ( ) ,
293295 }
294296 }
@@ -310,14 +312,18 @@ impl<'a, 'tcx> Visitor<'tcx> for VarVisitor<'a, 'tcx> {
310312 if ( meth. ident. name == sym:: index && self . cx. tcx. lang_items( ) . index_trait( ) == Some ( trait_id) )
311313 || ( meth. ident. name == sym:: index_mut && self . cx. tcx. lang_items( ) . index_mut_trait( ) == Some ( trait_id) ) ;
312314 if !self . check( args_1, args_0, expr) ;
313- then { return }
315+ then {
316+ return ;
317+ }
314318 }
315319
316320 if_chain ! {
317321 // an index op
318322 if let ExprKind :: Index ( seqexpr, idx) = expr. kind;
319323 if !self . check( idx, seqexpr, expr) ;
320- then { return }
324+ then {
325+ return ;
326+ }
321327 }
322328
323329 if_chain ! {
0 commit comments