Skip to content

Commit a0760cf

Browse files
committed
Rename kw::Empty as sym::empty.
Because the empty string is not a keyword.
1 parent 7debaf6 commit a0760cf

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

clippy_lints/src/manual_string_new.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use rustc_hir::{Expr, ExprKind, PathSegment, QPath, TyKind};
55
use rustc_lint::{LateContext, LateLintPass};
66
use rustc_middle::ty;
77
use rustc_session::declare_lint_pass;
8-
use rustc_span::{Span, sym, symbol};
8+
use rustc_span::{Span, sym};
99

1010
declare_clippy_lint! {
1111
/// ### What it does
@@ -67,7 +67,7 @@ impl LateLintPass<'_> for ManualStringNew {
6767
fn is_expr_kind_empty_str(expr_kind: &ExprKind<'_>) -> bool {
6868
if let ExprKind::Lit(lit) = expr_kind
6969
&& let LitKind::Str(value, _) = lit.node
70-
&& value == symbol::kw::Empty
70+
&& value == sym::empty
7171
{
7272
return true;
7373
}

clippy_lints/src/methods/or_fun_call.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use rustc_errors::Applicability;
1212
use rustc_lint::LateContext;
1313
use rustc_middle::ty;
1414
use rustc_span::Span;
15-
use rustc_span::symbol::{self, Symbol};
15+
use rustc_span::Symbol;
1616
use {rustc_ast as ast, rustc_hir as hir};
1717

1818
use super::{OR_FUN_CALL, UNWRAP_OR_DEFAULT};
@@ -265,7 +265,7 @@ fn closure_body_returns_empty_to_string(cx: &LateContext<'_>, e: &hir::Expr<'_>)
265265
&& ident.name == sym::to_string
266266
&& let hir::Expr { kind, .. } = self_arg
267267
&& let hir::ExprKind::Lit(lit) = kind
268-
&& let ast::LitKind::Str(symbol::kw::Empty, _) = lit.node
268+
&& let ast::LitKind::Str(rustc_span::sym::empty, _) = lit.node
269269
{
270270
return true;
271271
}

0 commit comments

Comments
 (0)