find: fix "item x imported redundantly" warnings

This commit is contained in:
Daniel Hofstetter
2024-02-26 09:47:24 +01:00
parent 30302305fd
commit f2bf4b0fd9
20 changed files with 6 additions and 31 deletions
-1
View File
@@ -33,7 +33,6 @@ mod tests {
use super::*;
use crate::find::matchers::tests::get_dir_entry_for;
use crate::find::matchers::Matcher;
use crate::find::tests::FakeDependencies;
#[test]
-1
View File
@@ -61,7 +61,6 @@ mod tests {
use super::*;
use crate::find::matchers::tests::get_dir_entry_for;
use crate::find::matchers::Matcher;
use crate::find::tests::FakeDependencies;
#[test]
+1 -1
View File
@@ -4,7 +4,7 @@
// license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.
use onig::{self, Regex, RegexOptions, Syntax};
use onig::{Regex, RegexOptions, Syntax};
/// Parse a string as a POSIX Basic Regular Expression.
fn parse_bre(expr: &str, options: RegexOptions) -> Result<Regex, onig::Error> {
-1
View File
@@ -60,7 +60,6 @@ impl Matcher for LinkNameMatcher {
mod tests {
use super::*;
use crate::find::matchers::tests::get_dir_entry_for;
use crate::find::matchers::Matcher;
use crate::find::tests::FakeDependencies;
use std::io::ErrorKind;
-3
View File
@@ -10,7 +10,6 @@
//! when parsing command-line options (e.g. "-foo -o -bar -baz" is equivalent
//! to "-foo -o ( -bar -baz )", not "( -foo -o -bar ) -baz").
use std::error::Error;
use std::iter::Iterator;
use std::path::Path;
use walkdir::DirEntry;
@@ -357,11 +356,9 @@ mod tests {
use super::*;
use crate::find::matchers::quit::QuitMatcher;
use crate::find::matchers::tests::get_dir_entry_for;
use crate::find::matchers::{Matcher, MatcherIO};
use crate::find::tests::FakeDependencies;
use std::cell::RefCell;
use std::rc::Rc;
use walkdir::DirEntry;
/// Simple Matcher impl that has side effects
pub struct HasSideEffects;
+1 -2
View File
@@ -544,8 +544,7 @@ mod tests {
use super::*;
use crate::find::tests::fix_up_slashes;
use crate::find::tests::FakeDependencies;
use crate::find::Config;
use walkdir::{DirEntry, WalkDir};
use walkdir::WalkDir;
/// Helper function for tests to get a DirEntry object. directory should
/// probably be a string starting with "test_data/" (cargo's tests run with
-1
View File
@@ -33,7 +33,6 @@ impl Matcher for NameMatcher {
mod tests {
use super::*;
use crate::find::matchers::tests::get_dir_entry_for;
use crate::find::matchers::Matcher;
use crate::find::tests::FakeDependencies;
use std::io::ErrorKind;
-1
View File
@@ -33,7 +33,6 @@ impl Matcher for PathMatcher {
mod tests {
use super::*;
use crate::find::matchers::tests::get_dir_entry_for;
use crate::find::matchers::Matcher;
use crate::find::tests::FakeDependencies;
// Variants of fix_up_slashes that properly escape the forward slashes for
-1
View File
@@ -144,7 +144,6 @@ mod tests {
use super::*;
use crate::find::matchers::tests::get_dir_entry_for;
use crate::find::matchers::Matcher;
use crate::find::tests::FakeDependencies;
#[track_caller]
-1
View File
@@ -57,7 +57,6 @@ impl Matcher for Printer {
mod tests {
use super::*;
use crate::find::matchers::tests::get_dir_entry_for;
use crate::find::matchers::Matcher;
use crate::find::tests::fix_up_slashes;
use crate::find::tests::FakeDependencies;
-1
View File
@@ -671,7 +671,6 @@ mod tests {
use super::*;
use crate::find::matchers::tests::get_dir_entry_for;
use crate::find::matchers::Matcher;
use crate::find::tests::fix_up_slashes;
use crate::find::tests::FakeDependencies;
-1
View File
@@ -31,7 +31,6 @@ impl Matcher for PruneMatcher {
mod tests {
use super::*;
use crate::find::matchers::tests::get_dir_entry_for;
use crate::find::matchers::Matcher;
use crate::find::tests::FakeDependencies;
#[test]
-1
View File
@@ -22,7 +22,6 @@ impl Matcher for QuitMatcher {
mod tests {
use super::*;
use crate::find::matchers::tests::get_dir_entry_for;
use crate::find::matchers::Matcher;
use crate::find::tests::FakeDependencies;
#[test]
-1
View File
@@ -121,7 +121,6 @@ impl Matcher for RegexMatcher {
mod tests {
use super::*;
use crate::find::matchers::tests::get_dir_entry_for;
use crate::find::matchers::Matcher;
use crate::find::tests::FakeDependencies;
const POSIX_BASIC_INTERVALS_RE: &str = r".*/ab\{1,3\}c";
-3
View File
@@ -106,10 +106,7 @@ impl Matcher for SizeMatcher {
mod tests {
use super::*;
use crate::find::matchers::tests::get_dir_entry_for;
use crate::find::matchers::{ComparableValue, Matcher};
use crate::find::tests::FakeDependencies;
// need to explicitly use non-pub members
use super::{byte_size_to_unit_size, Unit};
#[test]
fn test_byte_size_to_unit_size() {
-1
View File
@@ -84,7 +84,6 @@ mod tests {
use super::*;
use crate::find::matchers::tests::get_dir_entry_for;
use crate::find::matchers::Matcher;
use crate::find::tests::FakeDependencies;
#[test]
+2 -4
View File
@@ -139,15 +139,13 @@ impl FileTimeMatcher {
#[cfg(test)]
mod tests {
use std::fs::{File, OpenOptions};
use std::io::{Read, Write};
use std::io::Read;
use std::thread;
use std::time::{Duration, SystemTime};
use std::time::Duration;
use tempfile::Builder;
use walkdir::DirEntry;
use super::*;
use crate::find::matchers::tests::get_dir_entry_for;
use crate::find::matchers::{ComparableValue, Matcher};
use crate::find::tests::FakeDependencies;
#[test]
-1
View File
@@ -69,7 +69,6 @@ impl Matcher for TypeMatcher {
mod tests {
use super::*;
use crate::find::matchers::tests::get_dir_entry_for;
use crate::find::matchers::Matcher;
use crate::find::tests::FakeDependencies;
use std::io::ErrorKind;
+2 -4
View File
@@ -264,11 +264,9 @@ pub fn find_main<'a>(args: &[&str], deps: &'a dyn Dependencies<'a>) -> i32 {
#[cfg(test)]
mod tests {
use std::cell::RefCell;
use std::fs;
use std::io::{Cursor, ErrorKind, Read, Write};
use std::time::{Duration, SystemTime};
use std::vec::Vec;
use std::io::{Cursor, ErrorKind, Read};
use std::time::Duration;
use tempfile::Builder;
#[cfg(unix)]
-1
View File
@@ -8,7 +8,6 @@ use std::cell::RefCell;
use std::env;
use std::io::{Cursor, Read, Write};
use std::time::SystemTime;
use std::vec::Vec;
use walkdir::{DirEntry, WalkDir};
use findutils::find::matchers::MatcherIO;