@@ -10,7 +10,7 @@ use rustc_hir::def::{DefKind, Res};
10
10
use rustc_hir:: { Arm , BinOpKind , Expr , ExprKind , MatchSource , Node , PatKind , UnOp } ;
11
11
use rustc_lint:: LateContext ;
12
12
use rustc_span:: symbol:: Ident ;
13
- use rustc_span:: { Span , Symbol , sym} ;
13
+ use rustc_span:: { Span , sym} ;
14
14
use std:: borrow:: Cow ;
15
15
use std:: ops:: ControlFlow ;
16
16
@@ -95,15 +95,15 @@ pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, arms: &'tcx [Arm<'tcx>], msrv:
95
95
} else if let ExprKind :: MethodCall ( path, recv, args, ..) = guard. kind
96
96
&& let Some ( binding) = get_pat_binding ( cx, recv, outer_arm)
97
97
{
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) ;
99
99
}
100
100
}
101
101
}
102
102
103
103
fn check_method_calls < ' tcx > (
104
104
cx : & LateContext < ' tcx > ,
105
105
arm : & Arm < ' tcx > ,
106
- method : Symbol ,
106
+ method : & str ,
107
107
recv : & Expr < ' _ > ,
108
108
args : & [ Expr < ' _ > ] ,
109
109
if_expr : & Expr < ' _ > ,
@@ -112,7 +112,7 @@ fn check_method_calls<'tcx>(
112
112
let ty = cx. typeck_results ( ) . expr_ty ( recv) . peel_refs ( ) ;
113
113
let slice_like = ty. is_slice ( ) || ty. is_array ( ) ;
114
114
115
- let sugg = if method == sym ! ( is_empty) {
115
+ let sugg = if method == " is_empty" {
116
116
// `s if s.is_empty()` becomes ""
117
117
// `arr if arr.is_empty()` becomes []
118
118
@@ -137,9 +137,9 @@ fn check_method_calls<'tcx>(
137
137
138
138
if needles. is_empty ( ) {
139
139
sugg. insert_str ( 1 , ".." ) ;
140
- } else if method == sym ! ( starts_with) {
140
+ } else if method == " starts_with" {
141
141
sugg. insert_str ( sugg. len ( ) - 1 , ", .." ) ;
142
- } else if method == sym ! ( ends_with) {
142
+ } else if method == " ends_with" {
143
143
sugg. insert_str ( 1 , ".., " ) ;
144
144
} else {
145
145
return ;
0 commit comments