1
Fork 0

Use is_str instead of string kind comparison

This commit is contained in:
Michael Goulet 2023-02-13 18:33:44 +00:00
parent 0b439b119b
commit 3504c408f0
8 changed files with 11 additions and 12 deletions

View file

@ -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(),