more natural suggestions for cmp_owned (#14247)
Dereferencing string literals in suggestions is redundant. changelog: [`cmp_owned`]: more natural suggestions are provided for string literals now fixes #8103
This commit is contained in:
commit
3e528672a7
4 changed files with 32 additions and 2 deletions
|
|
@ -98,7 +98,7 @@ fn check_op(cx: &LateContext<'_>, expr: &Expr<'_>, other: &Expr<'_>, left: bool)
|
|||
let arg_snip = snippet(cx, arg_span, "..");
|
||||
let expr_snip;
|
||||
let eq_impl;
|
||||
if with_deref.is_implemented() {
|
||||
if with_deref.is_implemented() && !arg_ty.peel_refs().is_str() {
|
||||
expr_snip = format!("*{arg_snip}");
|
||||
eq_impl = with_deref;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue