Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 76ccfb4

Browse files
committed
Fix unnecessary keyword intern dogfood
1 parent 121c65f commit 76ccfb4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

clippy_lints/src/write.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ use rustc_lexer::unescape::{self, EscapeError};
1010
use rustc_lint::{EarlyContext, EarlyLintPass};
1111
use rustc_parse::parser;
1212
use rustc_session::{declare_tool_lint, impl_lint_pass};
13-
use rustc_span::{sym, BytePos, Span, Symbol};
13+
use rustc_span::symbol::kw;
14+
use rustc_span::{sym, BytePos, Span};
1415

1516
declare_clippy_lint! {
1617
/// **What it does:** This lint warns when you use `println!("")` to
@@ -301,7 +302,7 @@ impl EarlyLintPass for Write {
301302
}
302303
} else if mac.path == sym!(writeln) {
303304
if let (Some(fmt_str), expr) = self.check_tts(cx, mac.args.inner_tokens(), true) {
304-
if fmt_str.symbol == Symbol::intern("") {
305+
if fmt_str.symbol == kw::Empty {
305306
let mut applicability = Applicability::MachineApplicable;
306307
// FIXME: remove this `#[allow(...)]` once the issue #5822 gets fixed
307308
#[allow(clippy::option_if_let_else)]
@@ -484,7 +485,7 @@ impl Write {
484485

485486
fn lint_println_empty_string(&self, cx: &EarlyContext<'_>, mac: &MacCall) {
486487
if let (Some(fmt_str), _) = self.check_tts(cx, mac.args.inner_tokens(), false) {
487-
if fmt_str.symbol == Symbol::intern("") {
488+
if fmt_str.symbol == kw::Empty {
488489
let name = mac.path.segments[0].ident.name;
489490
span_lint_and_sugg(
490491
cx,

0 commit comments

Comments
 (0)