Skip to content

Commit

Permalink
refactor: use rustc_span::sym for method name comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
chansuke committed Jan 24, 2023
1 parent 8dd249e commit ceb4d46
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clippy_lints/src/unnecessary_reserve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ fn check_extend_method(
if let ExprKind::MethodCall(_, struct_calling_on, _,_) = expr.kind
&& let Some(expr_def_id) = cx.typeck_results().type_dependent_def_id(expr.hir_id)
&& let ExprKind::MethodCall(PathSegment { ident: method_call_a, .. },..) = args_a_kind
&& method_call_a.name.as_str() == "len"
&& method_call_a.name == rustc_span::sym::len
&& match_def_path(cx, expr_def_id, &paths::ITER_EXTEND)
&& acceptable_type(cx, struct_calling_on)
// Check that both expr are equal
Expand Down

0 comments on commit ceb4d46

Please sign in to comment.