@@ -94,7 +94,7 @@ fn has_no_read_access<'tcx>(cx: &LateContext<'tcx>, id: HirId, block: &'tcx Bloc
9494 // `id` appearing in the left-hand side of an assignment is not a read access:
9595 //
9696 // id = ...; // Not reading `id`.
97- if let Some ( Node :: Expr ( parent) ) = get_parent_node ( cx. tcx , expr. hir_id )
97+ if let Node :: Expr ( parent) = get_parent_node ( cx. tcx , expr. hir_id )
9898 && let ExprKind :: Assign ( lhs, ..) = parent. kind
9999 && path_to_local_id ( lhs, id)
100100 {
@@ -108,7 +108,7 @@ fn has_no_read_access<'tcx>(cx: &LateContext<'tcx>, id: HirId, block: &'tcx Bloc
108108 // Only assuming this for "official" methods defined on the type. For methods defined in extension
109109 // traits (identified as local, based on the orphan rule), pessimistically assume that they might
110110 // have side effects, so consider them a read.
111- if let Some ( Node :: Expr ( parent) ) = get_parent_node ( cx. tcx , expr. hir_id )
111+ if let Node :: Expr ( parent) = get_parent_node ( cx. tcx , expr. hir_id )
112112 && let ExprKind :: MethodCall ( _, receiver, _, _) = parent. kind
113113 && path_to_local_id ( receiver, id)
114114 && let Some ( method_def_id) = cx. typeck_results ( ) . type_dependent_def_id ( parent. hir_id )
@@ -117,7 +117,7 @@ fn has_no_read_access<'tcx>(cx: &LateContext<'tcx>, id: HirId, block: &'tcx Bloc
117117 // The method call is a statement, so the return value is not used. That's not a read access:
118118 //
119119 // id.foo(args);
120- if let Some ( Node :: Stmt ( ..) ) = get_parent_node ( cx. tcx , parent. hir_id ) {
120+ if let Node :: Stmt ( ..) = get_parent_node ( cx. tcx , parent. hir_id ) {
121121 return ControlFlow :: Continue ( ( ) ) ;
122122 }
123123
0 commit comments