From 501fd1e07e3f10229188e30df6f35311ab68124b Mon Sep 17 00:00:00 2001 From: Daniel Hofstetter Date: Mon, 19 Feb 2024 15:19:36 +0100 Subject: [PATCH] Fix "item x imported redundantly" warnings --- src/uu/cp/src/cp.rs | 1 - src/uu/env/src/env.rs | 1 - src/uu/join/src/join.rs | 1 - src/uu/od/src/multifilereader.rs | 4 +--- src/uu/pr/src/pr.rs | 1 - src/uu/ptx/src/ptx.rs | 1 - src/uu/sleep/src/sleep.rs | 2 +- src/uu/wc/src/utf8/read.rs | 1 - src/uucore/src/lib/features/encoding.rs | 4 +--- src/uucore/src/lib/features/fsext.rs | 2 -- src/uucore/src/lib/features/perms.rs | 10 +++------- src/uucore/src/lib/mods/error.rs | 1 - tests/by-util/test_touch.rs | 2 +- 13 files changed, 7 insertions(+), 24 deletions(-) diff --git a/src/uu/cp/src/cp.rs b/src/uu/cp/src/cp.rs index 7961202482c..9a3a0848342 100644 --- a/src/uu/cp/src/cp.rs +++ b/src/uu/cp/src/cp.rs @@ -17,7 +17,6 @@ use std::os::unix::ffi::OsStrExt; #[cfg(unix)] use std::os::unix::fs::{FileTypeExt, PermissionsExt}; use std::path::{Path, PathBuf, StripPrefixError}; -use std::string::ToString; use clap::{builder::ValueParser, crate_version, Arg, ArgAction, ArgMatches, Command}; use filetime::FileTime; diff --git a/src/uu/env/src/env.rs b/src/uu/env/src/env.rs index 608357f5050..1680d4f4d5b 100644 --- a/src/uu/env/src/env.rs +++ b/src/uu/env/src/env.rs @@ -12,7 +12,6 @@ use nix::sys::signal::{raise, sigaction, SaFlags, SigAction, SigHandler, SigSet, use std::borrow::Cow; use std::env; use std::io::{self, Write}; -use std::iter::Iterator; #[cfg(unix)] use std::os::unix::process::ExitStatusExt; use std::process; diff --git a/src/uu/join/src/join.rs b/src/uu/join/src/join.rs index 423af983ec9..3b0c8dfb958 100644 --- a/src/uu/join/src/join.rs +++ b/src/uu/join/src/join.rs @@ -9,7 +9,6 @@ use clap::builder::ValueParser; use clap::{crate_version, Arg, ArgAction, Command}; use memchr::{memchr3_iter, memchr_iter}; use std::cmp::Ordering; -use std::convert::From; use std::error::Error; use std::ffi::OsString; use std::fmt::Display; diff --git a/src/uu/od/src/multifilereader.rs b/src/uu/od/src/multifilereader.rs index f7575e975de..813ef029f37 100644 --- a/src/uu/od/src/multifilereader.rs +++ b/src/uu/od/src/multifilereader.rs @@ -5,9 +5,7 @@ // spell-checker:ignore (ToDO) multifile curr fnames fname xfrd fillloop mockstream use std::fs::File; -use std::io; -use std::io::BufReader; -use std::vec::Vec; +use std::io::{self, BufReader}; use uucore::display::Quotable; use uucore::show_error; diff --git a/src/uu/pr/src/pr.rs b/src/uu/pr/src/pr.rs index e6e573e0ff5..010183d3192 100644 --- a/src/uu/pr/src/pr.rs +++ b/src/uu/pr/src/pr.rs @@ -11,7 +11,6 @@ use clap::{crate_version, Arg, ArgAction, ArgMatches, Command}; use itertools::Itertools; use quick_error::ResultExt; use regex::Regex; -use std::convert::From; use std::fs::{metadata, File}; use std::io::{stdin, stdout, BufRead, BufReader, Lines, Read, Write}; #[cfg(unix)] diff --git a/src/uu/ptx/src/ptx.rs b/src/uu/ptx/src/ptx.rs index 7caa8f4a5d4..b952da92931 100644 --- a/src/uu/ptx/src/ptx.rs +++ b/src/uu/ptx/src/ptx.rs @@ -9,7 +9,6 @@ use clap::{crate_version, Arg, ArgAction, Command}; use regex::Regex; use std::cmp; use std::collections::{BTreeSet, HashMap, HashSet}; -use std::default::Default; use std::error::Error; use std::fmt::{Display, Formatter, Write as FmtWrite}; use std::fs::File; diff --git a/src/uu/sleep/src/sleep.rs b/src/uu/sleep/src/sleep.rs index b1d6bd89958..36e3adfee1e 100644 --- a/src/uu/sleep/src/sleep.rs +++ b/src/uu/sleep/src/sleep.rs @@ -12,7 +12,7 @@ use uucore::{ }; use clap::{crate_version, Arg, ArgAction, Command}; -use fundu::{self, DurationParser, ParseError, SaturatingInto}; +use fundu::{DurationParser, ParseError, SaturatingInto}; static ABOUT: &str = help_about!("sleep.md"); const USAGE: &str = help_usage!("sleep.md"); diff --git a/src/uu/wc/src/utf8/read.rs b/src/uu/wc/src/utf8/read.rs index 4a92d85e688..819b0a6891c 100644 --- a/src/uu/wc/src/utf8/read.rs +++ b/src/uu/wc/src/utf8/read.rs @@ -7,7 +7,6 @@ use super::*; use std::error::Error; use std::fmt; use std::io::{self, BufRead}; -use std::str; /// Wraps a `std::io::BufRead` buffered byte stream and decode it as UTF-8. pub struct BufReadDecoder { diff --git a/src/uucore/src/lib/features/encoding.rs b/src/uucore/src/lib/features/encoding.rs index db218d5f061..0ed54839dc0 100644 --- a/src/uucore/src/lib/features/encoding.rs +++ b/src/uucore/src/lib/features/encoding.rs @@ -6,11 +6,9 @@ // spell-checker:ignore (strings) ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUV // spell-checker:ignore (encodings) lsbf msbf hexupper -use data_encoding::{self, BASE32, BASE64}; - use std::io::{self, Read, Write}; -use data_encoding::{Encoding, BASE32HEX, BASE64URL, HEXUPPER}; +use data_encoding::{Encoding, BASE32, BASE32HEX, BASE64, BASE64URL, HEXUPPER}; use data_encoding_macro::new_encoding; #[cfg(feature = "thiserror")] use thiserror::Error; diff --git a/src/uucore/src/lib/features/fsext.rs b/src/uucore/src/lib/features/fsext.rs index 89ffab7f486..3a23682c160 100644 --- a/src/uucore/src/lib/features/fsext.rs +++ b/src/uucore/src/lib/features/fsext.rs @@ -63,8 +63,6 @@ use libc::{ mode_t, strerror, S_IFBLK, S_IFCHR, S_IFDIR, S_IFIFO, S_IFLNK, S_IFMT, S_IFREG, S_IFSOCK, }; use std::borrow::Cow; -#[cfg(not(windows))] -use std::convert::From; #[cfg(unix)] use std::ffi::CStr; #[cfg(unix)] diff --git a/src/uucore/src/lib/features/perms.rs b/src/uucore/src/lib/features/perms.rs index 5384b52a18f..37ed4113792 100644 --- a/src/uucore/src/lib/features/perms.rs +++ b/src/uucore/src/lib/features/perms.rs @@ -6,16 +6,12 @@ //! Common functions to manage permissions use crate::display::Quotable; -use crate::error::strip_errno; -use crate::error::UResult; -use crate::error::USimpleError; +use crate::error::{strip_errno, UResult, USimpleError}; pub use crate::features::entries; use crate::fs::resolve_relative_path; use crate::show_error; -use clap::Arg; -use clap::ArgMatches; -use clap::Command; -use libc::{self, gid_t, uid_t}; +use clap::{Arg, ArgMatches, Command}; +use libc::{gid_t, uid_t}; use walkdir::WalkDir; use std::io::Error as IOError; diff --git a/src/uucore/src/lib/mods/error.rs b/src/uucore/src/lib/mods/error.rs index 82644ae8a50..5720a6bef96 100644 --- a/src/uucore/src/lib/mods/error.rs +++ b/src/uucore/src/lib/mods/error.rs @@ -56,7 +56,6 @@ // spell-checker:ignore uioerror rustdoc -use clap; use std::{ error::Error, fmt::{Display, Formatter}, diff --git a/tests/by-util/test_touch.rs b/tests/by-util/test_touch.rs index 7b659fc5155..5cc0ba5856c 100644 --- a/tests/by-util/test_touch.rs +++ b/tests/by-util/test_touch.rs @@ -5,7 +5,7 @@ // spell-checker:ignore (formats) cymdhm cymdhms mdhm mdhms ymdhm ymdhms datetime mktime use crate::common::util::{AtPath, TestScenario}; -use filetime::{self, FileTime}; +use filetime::FileTime; use std::fs::remove_file; use std::path::PathBuf;