Skip to content

Commit ceb4d46

Browse files
committed
refactor: use rustc_span::sym for method name comparison
1 parent 8dd249e commit ceb4d46

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_lints/src/unnecessary_reserve.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ fn check_extend_method(
105105
if let ExprKind::MethodCall(_, struct_calling_on, _,_) = expr.kind
106106
&& let Some(expr_def_id) = cx.typeck_results().type_dependent_def_id(expr.hir_id)
107107
&& let ExprKind::MethodCall(PathSegment { ident: method_call_a, .. },..) = args_a_kind
108-
&& method_call_a.name.as_str() == "len"
108+
&& method_call_a.name == rustc_span::sym::len
109109
&& match_def_path(cx, expr_def_id, &paths::ITER_EXTEND)
110110
&& acceptable_type(cx, struct_calling_on)
111111
// Check that both expr are equal

0 commit comments

Comments
 (0)