@@ -10,7 +10,7 @@ use rustc_hir::def::{DefKind, Res};
1010use rustc_hir:: { Arm , BinOpKind , Expr , ExprKind , MatchSource , Node , PatKind , UnOp } ;
1111use rustc_lint:: LateContext ;
1212use rustc_span:: symbol:: Ident ;
13- use rustc_span:: { Span , Symbol , sym} ;
13+ use rustc_span:: { Span , sym} ;
1414use std:: borrow:: Cow ;
1515use std:: ops:: ControlFlow ;
1616
@@ -95,15 +95,15 @@ pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, arms: &'tcx [Arm<'tcx>], msrv:
9595 } else if let ExprKind :: MethodCall ( path, recv, args, ..) = guard. kind
9696 && let Some ( binding) = get_pat_binding ( cx, recv, outer_arm)
9797 {
98- check_method_calls ( cx, outer_arm, path. ident . name , recv, args, guard, & binding) ;
98+ check_method_calls ( cx, outer_arm, path. ident . name . as_str ( ) , recv, args, guard, & binding) ;
9999 }
100100 }
101101}
102102
103103fn check_method_calls < ' tcx > (
104104 cx : & LateContext < ' tcx > ,
105105 arm : & Arm < ' tcx > ,
106- method : Symbol ,
106+ method : & str ,
107107 recv : & Expr < ' _ > ,
108108 args : & [ Expr < ' _ > ] ,
109109 if_expr : & Expr < ' _ > ,
@@ -112,7 +112,7 @@ fn check_method_calls<'tcx>(
112112 let ty = cx. typeck_results ( ) . expr_ty ( recv) . peel_refs ( ) ;
113113 let slice_like = ty. is_slice ( ) || ty. is_array ( ) ;
114114
115- let sugg = if method == sym ! ( is_empty) {
115+ let sugg = if method == " is_empty" {
116116 // `s if s.is_empty()` becomes ""
117117 // `arr if arr.is_empty()` becomes []
118118
@@ -137,9 +137,9 @@ fn check_method_calls<'tcx>(
137137
138138 if needles. is_empty ( ) {
139139 sugg. insert_str ( 1 , ".." ) ;
140- } else if method == sym ! ( starts_with) {
140+ } else if method == " starts_with" {
141141 sugg. insert_str ( sugg. len ( ) - 1 , ", .." ) ;
142- } else if method == sym ! ( ends_with) {
142+ } else if method == " ends_with" {
143143 sugg. insert_str ( 1 , ".., " ) ;
144144 } else {
145145 return ;
0 commit comments