Use is_str instead of string kind comparison
This commit is contained in:
parent
0b439b119b
commit
3504c408f0
8 changed files with 11 additions and 12 deletions
|
@ -146,7 +146,7 @@ fn check_panic<'tcx>(cx: &LateContext<'tcx>, f: &'tcx hir::Expr<'tcx>, arg: &'tc
|
|||
// If this is a &str or String, we can confidently give the `"{}", ` suggestion.
|
||||
let is_str = matches!(
|
||||
ty.kind(),
|
||||
ty::Ref(_, r, _) if *r.kind() == ty::Str,
|
||||
ty::Ref(_, r, _) if r.is_str(),
|
||||
) || matches!(
|
||||
ty.ty_adt_def(),
|
||||
Some(ty_def) if Some(ty_def.did()) == cx.tcx.lang_items().string(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue