@@ -94,7 +94,7 @@ fn has_no_read_access<'tcx>(cx: &LateContext<'tcx>, id: HirId, block: &'tcx Bloc
94
94
// `id` appearing in the left-hand side of an assignment is not a read access:
95
95
//
96
96
// 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 )
98
98
&& let ExprKind :: Assign ( lhs, ..) = parent. kind
99
99
&& path_to_local_id ( lhs, id)
100
100
{
@@ -108,7 +108,7 @@ fn has_no_read_access<'tcx>(cx: &LateContext<'tcx>, id: HirId, block: &'tcx Bloc
108
108
// Only assuming this for "official" methods defined on the type. For methods defined in extension
109
109
// traits (identified as local, based on the orphan rule), pessimistically assume that they might
110
110
// 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 )
112
112
&& let ExprKind :: MethodCall ( _, receiver, _, _) = parent. kind
113
113
&& path_to_local_id ( receiver, id)
114
114
&& 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
117
117
// The method call is a statement, so the return value is not used. That's not a read access:
118
118
//
119
119
// 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 ) {
121
121
return ControlFlow :: Continue ( ( ) ) ;
122
122
}
123
123
0 commit comments