mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-16 17:58:14 +00:00
Fix unnecessary keyword intern dogfood
This commit is contained in:
parent
121c65f0cf
commit
76ccfb4ae2
1 changed files with 4 additions and 3 deletions
|
@ -10,7 +10,8 @@ use rustc_lexer::unescape::{self, EscapeError};
|
|||
use rustc_lint::{EarlyContext, EarlyLintPass};
|
||||
use rustc_parse::parser;
|
||||
use rustc_session::{declare_tool_lint, impl_lint_pass};
|
||||
use rustc_span::{sym, BytePos, Span, Symbol};
|
||||
use rustc_span::symbol::kw;
|
||||
use rustc_span::{sym, BytePos, Span};
|
||||
|
||||
declare_clippy_lint! {
|
||||
/// **What it does:** This lint warns when you use `println!("")` to
|
||||
|
@ -301,7 +302,7 @@ impl EarlyLintPass for Write {
|
|||
}
|
||||
} else if mac.path == sym!(writeln) {
|
||||
if let (Some(fmt_str), expr) = self.check_tts(cx, mac.args.inner_tokens(), true) {
|
||||
if fmt_str.symbol == Symbol::intern("") {
|
||||
if fmt_str.symbol == kw::Empty {
|
||||
let mut applicability = Applicability::MachineApplicable;
|
||||
// FIXME: remove this `#[allow(...)]` once the issue #5822 gets fixed
|
||||
#[allow(clippy::option_if_let_else)]
|
||||
|
@ -484,7 +485,7 @@ impl Write {
|
|||
|
||||
fn lint_println_empty_string(&self, cx: &EarlyContext<'_>, mac: &MacCall) {
|
||||
if let (Some(fmt_str), _) = self.check_tts(cx, mac.args.inner_tokens(), false) {
|
||||
if fmt_str.symbol == Symbol::intern("") {
|
||||
if fmt_str.symbol == kw::Empty {
|
||||
let name = mac.path.segments[0].ident.name;
|
||||
span_lint_and_sugg(
|
||||
cx,
|
||||
|
|
Loading…
Reference in a new issue