summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Gallant <jamslam@gmail.com>2024-03-07 09:37:48 -0500
committerAndrew Gallant <jamslam@gmail.com>2024-03-07 09:37:48 -0500
commit59212d08d3ef122adc781dfa09343df7848febf8 (patch)
tree8298e08f689b88ebca0e07948be31efda2d1ff5f
parent6ebebb2aaa9991694aed10b944cf2e8196811e1c (diff)
style: fix new lints
The Rust compiler seems to have gotten smarter at finding unused or redundant imports.
-rw-r--r--crates/cli/src/wtr.rs2
-rw-r--r--crates/core/logger.rs2
-rw-r--r--crates/ignore/src/walk.rs2
-rw-r--r--crates/pcre2/src/matcher.rs2
-rw-r--r--crates/regex/src/matcher.rs2
-rw-r--r--crates/searcher/src/line_buffer.rs2
-rw-r--r--crates/searcher/src/lines.rs2
-rw-r--r--crates/searcher/src/searcher/mod.rs1
-rw-r--r--crates/searcher/src/testutil.rs2
9 files changed, 5 insertions, 12 deletions
diff --git a/crates/cli/src/wtr.rs b/crates/cli/src/wtr.rs
index 44eb54d5..e9cfb3b7 100644
--- a/crates/cli/src/wtr.rs
+++ b/crates/cli/src/wtr.rs
@@ -1,6 +1,6 @@
use std::io::{self, IsTerminal};
-use termcolor::{self, HyperlinkSpec};
+use termcolor::HyperlinkSpec;
/// A writer that supports coloring with either line or block buffering.
#[derive(Debug)]
diff --git a/crates/core/logger.rs b/crates/core/logger.rs
index 0b58d1d6..ce4e0e9d 100644
--- a/crates/core/logger.rs
+++ b/crates/core/logger.rs
@@ -6,7 +6,7 @@ print to stderr. We therefore avoid bringing in extra dependencies just for
this functionality.
*/
-use log::{self, Log};
+use log::Log;
/// The simplest possible logger that logs to stderr.
///
diff --git a/crates/ignore/src/walk.rs b/crates/ignore/src/walk.rs
index 2288fe0b..a8d17180 100644
--- a/crates/ignore/src/walk.rs
+++ b/crates/ignore/src/walk.rs
@@ -11,7 +11,7 @@ use std::{
use {
crossbeam_deque::{Stealer, Worker as Deque},
same_file::Handle,
- walkdir::{self, WalkDir},
+ walkdir::WalkDir,
};
use crate::{
diff --git a/crates/pcre2/src/matcher.rs b/crates/pcre2/src/matcher.rs
index ecc7c16f..56c9356d 100644
--- a/crates/pcre2/src/matcher.rs
+++ b/crates/pcre2/src/matcher.rs
@@ -428,7 +428,7 @@ fn has_uppercase_literal(pattern: &str) -> bool {
#[cfg(test)]
mod tests {
- use grep_matcher::{LineMatchKind, Matcher};
+ use grep_matcher::LineMatchKind;
use super::*;
diff --git a/crates/regex/src/matcher.rs b/crates/regex/src/matcher.rs
index 003d415c..7c1b87ed 100644
--- a/crates/regex/src/matcher.rs
+++ b/crates/regex/src/matcher.rs
@@ -552,8 +552,6 @@ impl RegexCaptures {
#[cfg(test)]
mod tests {
- use grep_matcher::{LineMatchKind, Matcher};
-
use super::*;
// Test that enabling word matches does the right thing and demonstrate
diff --git a/crates/searcher/src/line_buffer.rs b/crates/searcher/src/line_buffer.rs
index 822bdee4..e73c6504 100644
--- a/crates/searcher/src/line_buffer.rs
+++ b/crates/searcher/src/line_buffer.rs
@@ -548,7 +548,7 @@ fn replace_bytes(
#[cfg(test)]
mod tests {
- use bstr::{ByteSlice, ByteVec};
+ use bstr::ByteVec;
use super::*;
diff --git a/crates/searcher/src/lines.rs b/crates/searcher/src/lines.rs
index 98f54fa4..95091d91 100644
--- a/crates/searcher/src/lines.rs
+++ b/crates/searcher/src/lines.rs
@@ -198,8 +198,6 @@ fn preceding_by_pos(
#[cfg(test)]
mod tests {
- use grep_matcher::Match;
-
use super::*;
const SHERLOCK: &'static str = "\
diff --git a/crates/searcher/src/searcher/mod.rs b/crates/searcher/src/searcher/mod.rs
index d4bd1563..deda17e5 100644
--- a/crates/searcher/src/searcher/mod.rs
+++ b/crates/searcher/src/searcher/mod.rs
@@ -7,7 +7,6 @@ use std::{
};
use {
- encoding_rs,
encoding_rs_io::DecodeReaderBytesBuilder,
grep_matcher::{LineTerminator, Match, Matcher},
};
diff --git a/crates/searcher/src/testutil.rs b/crates/searcher/src/testutil.rs
index 49d28e5e..99e297d1 100644
--- a/crates/searcher/src/testutil.rs
+++ b/crates/searcher/src/testutil.rs
@@ -725,8 +725,6 @@ impl TesterConfig {
#[cfg(test)]
mod tests {
- use grep_matcher::{Match, Matcher};
-
use super::*;
fn m(start: usize, end: usize) -> Match {