diff options
| author | Michael Goulet <michael@errs.io> | 2023-02-13 18:33:44 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-02-13 19:06:22 +0000 |
| commit | 3504c408f0af5f9a81c55a2bd1de14c68b70a291 (patch) | |
| tree | a01d6cbb60149973084c1459f4a267f76d6499d0 /compiler | |
| parent | 0b439b119b8d49450bddbbea317afeb0d4166f70 (diff) | |
| download | rust-3504c408f0af5f9a81c55a2bd1de14c68b70a291.tar.gz rust-3504c408f0af5f9a81c55a2bd1de14c68b70a291.zip | |
Use is_str instead of string kind comparison
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_lint/src/non_fmt_panic.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_lint/src/non_fmt_panic.rs b/compiler/rustc_lint/src/non_fmt_panic.rs index 4a02c6cce47..548f30ec972 100644 --- a/compiler/rustc_lint/src/non_fmt_panic.rs +++ b/compiler/rustc_lint/src/non_fmt_panic.rs @@ -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(), |
