diff options
| author | Timo <30553356+y21@users.noreply.github.com> | 2025-04-27 12:56:14 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-27 12:56:14 +0000 |
| commit | 0dd9722cdc613c90ffc02f6bfb3185185c7ded3f (patch) | |
| tree | 52e2b329e284151c58e0113717dec2b49e53de2d /clippy_lints/src/missing_fields_in_debug.rs | |
| parent | 39a408664b383865a56a0a76bbef6e36654edf7d (diff) | |
| parent | 7b337f6e259ce3ae19e1c0c22c8ff493ecb4a8a3 (diff) | |
| download | rust-0dd9722cdc613c90ffc02f6bfb3185185c7ded3f.tar.gz rust-0dd9722cdc613c90ffc02f6bfb3185185c7ded3f.zip | |
Replace some `Symbol::as_str` usage (#14679)
Follow up to https://github.com/rust-lang/rust-clippy/pull/14650 Replaces uses in the form `s.as_str() == "literal"` r? @y21 changelog: none
Diffstat (limited to 'clippy_lints/src/missing_fields_in_debug.rs')
| -rw-r--r-- | clippy_lints/src/missing_fields_in_debug.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clippy_lints/src/missing_fields_in_debug.rs b/clippy_lints/src/missing_fields_in_debug.rs index 1932d2d5f97..be7dd74fd62 100644 --- a/clippy_lints/src/missing_fields_in_debug.rs +++ b/clippy_lints/src/missing_fields_in_debug.rs @@ -1,9 +1,9 @@ use std::ops::ControlFlow; use clippy_utils::diagnostics::span_lint_and_then; -use clippy_utils::is_path_lang_item; use clippy_utils::ty::is_type_diagnostic_item; use clippy_utils::visitors::{Visitable, for_each_expr}; +use clippy_utils::{is_path_lang_item, sym}; use rustc_ast::LitKind; use rustc_data_structures::fx::FxHashSet; use rustc_hir::def::{DefKind, Res}; @@ -13,7 +13,7 @@ use rustc_hir::{ use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty::{Ty, TypeckResults}; use rustc_session::declare_lint_pass; -use rustc_span::{Span, Symbol, sym}; +use rustc_span::{Span, Symbol}; declare_clippy_lint! { /// ### What it does @@ -116,7 +116,7 @@ fn should_lint<'tcx>( if path.ident.name == sym::debug_struct && is_type_diagnostic_item(cx, recv_ty, sym::Formatter) { has_debug_struct = true; - } else if path.ident.name.as_str() == "finish_non_exhaustive" + } else if path.ident.name == sym::finish_non_exhaustive && is_type_diagnostic_item(cx, recv_ty, sym::DebugStruct) { has_finish_non_exhaustive = true; |
