From f38bba18ee29c8789bb8bf34ddaf7b76605a37fd Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Sat, 26 Nov 2022 15:56:33 -0500 Subject: [PATCH] Fix clippy warnings --- src/linter.rs | 4 +++- src/noqa.rs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/linter.rs b/src/linter.rs index 1bcc156509..cd2148e6e7 100644 --- a/src/linter.rs +++ b/src/linter.rs @@ -7,6 +7,7 @@ use std::path::Path; use anyhow::Result; #[cfg(not(target_family = "wasm"))] use log::debug; +use nohash_hasher::IntMap; use rustpython_parser::lexer::LexResult; use crate::ast::types::Range; @@ -46,6 +47,7 @@ impl AddAssign for Diagnostics { /// Generate a list of `Check` violations from the source code contents at the /// given `Path`. +#[allow(clippy::too_many_arguments)] pub(crate) fn check_path( path: &Path, contents: &str, @@ -252,7 +254,7 @@ pub fn add_noqa_to_path(path: &Path, settings: &Settings) -> Result { tokens, &locator, &Directives { - noqa_line_for: Default::default(), + noqa_line_for: IntMap::default(), isort_exclusions: directives.isort_exclusions, }, settings, diff --git a/src/noqa.rs b/src/noqa.rs index d511512162..c59f48f08e 100644 --- a/src/noqa.rs +++ b/src/noqa.rs @@ -116,7 +116,7 @@ fn add_noqa_inner( let mut new_line = String::new(); // Add existing content. - new_line.push_str(&line[..start].trim_end()); + new_line.push_str(line[..start].trim_end()); // Add `noqa` directive. new_line.push_str(" # noqa: ");