diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-05-22 11:55:22 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-05-22 11:55:22 +1000 |
| commit | 849cabf4c4a97f0a1c6320993b08bf8e6068e58f (patch) | |
| tree | 2dfb364b265e3a61be8ef37f2252564d027408fd /src | |
| parent | bf64d66bd58719fac2585eae5e546e5e1d9947f5 (diff) | |
| download | rust-849cabf4c4a97f0a1c6320993b08bf8e6068e58f.tar.gz rust-849cabf4c4a97f0a1c6320993b08bf8e6068e58f.zip | |
Rename `kw::Empty` as `sym::empty`.
Because the empty string is not a keyword.
Diffstat (limited to 'src')
| -rw-r--r-- | src/tools/clippy/clippy_lints/src/manual_string_new.rs | 4 | ||||
| -rw-r--r-- | src/tools/clippy/clippy_lints/src/methods/or_fun_call.rs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/tools/clippy/clippy_lints/src/manual_string_new.rs b/src/tools/clippy/clippy_lints/src/manual_string_new.rs index 7ca3b712066..73ee1c3c78a 100644 --- a/src/tools/clippy/clippy_lints/src/manual_string_new.rs +++ b/src/tools/clippy/clippy_lints/src/manual_string_new.rs @@ -5,7 +5,7 @@ use rustc_hir::{Expr, ExprKind, PathSegment, QPath, TyKind}; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty; use rustc_session::declare_lint_pass; -use rustc_span::{Span, sym, symbol}; +use rustc_span::{Span, sym}; declare_clippy_lint! { /// ### What it does @@ -67,7 +67,7 @@ impl LateLintPass<'_> for ManualStringNew { fn is_expr_kind_empty_str(expr_kind: &ExprKind<'_>) -> bool { if let ExprKind::Lit(lit) = expr_kind && let LitKind::Str(value, _) = lit.node - && value == symbol::kw::Empty + && value == sym::empty { return true; } diff --git a/src/tools/clippy/clippy_lints/src/methods/or_fun_call.rs b/src/tools/clippy/clippy_lints/src/methods/or_fun_call.rs index c74c42e9e5b..38cb4d51ca0 100644 --- a/src/tools/clippy/clippy_lints/src/methods/or_fun_call.rs +++ b/src/tools/clippy/clippy_lints/src/methods/or_fun_call.rs @@ -12,7 +12,7 @@ use rustc_errors::Applicability; use rustc_lint::LateContext; use rustc_middle::ty; use rustc_span::Span; -use rustc_span::symbol::{self, Symbol}; +use rustc_span::Symbol; use {rustc_ast as ast, rustc_hir as hir}; use super::{OR_FUN_CALL, UNWRAP_OR_DEFAULT}; @@ -265,7 +265,7 @@ fn closure_body_returns_empty_to_string(cx: &LateContext<'_>, e: &hir::Expr<'_>) && ident.name == sym::to_string && let hir::Expr { kind, .. } = self_arg && let hir::ExprKind::Lit(lit) = kind - && let ast::LitKind::Str(symbol::kw::Empty, _) = lit.node + && let ast::LitKind::Str(rustc_span::sym::empty, _) = lit.node { return true; } |
