diff --git a/src/uu/cp/src/cp.rs b/src/uu/cp/src/cp.rs index 796120248..9a3a08483 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 608357f50..1680d4f4d 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 423af983e..3b0c8dfb9 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 f7575e975..813ef029f 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 e6e573e0f..010183d31 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 7caa8f4a5..b952da929 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 b1d6bd899..36e3adfee 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/stat/src/stat.rs b/src/uu/stat/src/stat.rs index f9fe5ee59..fe007397d 100644 --- a/src/uu/stat/src/stat.rs +++ b/src/uu/stat/src/stat.rs @@ -17,7 +17,6 @@ use uucore::{ use chrono::{DateTime, Local}; use clap::{crate_version, Arg, ArgAction, ArgMatches, Command}; use std::borrow::Cow; -use std::convert::AsRef; use std::ffi::{OsStr, OsString}; use std::fs; use std::os::unix::fs::{FileTypeExt, MetadataExt}; diff --git a/src/uu/timeout/src/status.rs b/src/uu/timeout/src/status.rs index 10103ab9b..7a94c7f94 100644 --- a/src/uu/timeout/src/status.rs +++ b/src/uu/timeout/src/status.rs @@ -3,7 +3,6 @@ // For the full copyright and license information, please view the LICENSE // file that was distributed with this source code. //! Exit status codes produced by `timeout`. -use std::convert::From; use uucore::error::UError; /// Enumerates the exit statuses produced by `timeout`. diff --git a/src/uu/wc/src/utf8/read.rs b/src/uu/wc/src/utf8/read.rs index 4a92d85e6..819b0a689 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/backup_control.rs b/src/uucore/src/lib/features/backup_control.rs index fedbb375c..99889a6ff 100644 --- a/src/uucore/src/lib/features/backup_control.rs +++ b/src/uucore/src/lib/features/backup_control.rs @@ -474,7 +474,6 @@ pub fn source_is_target_backup(source: &Path, target: &Path, suffix: &str) -> bo #[cfg(test)] mod tests { use super::*; - use std::env; // Required to instantiate mutex in shared context use clap::Command; use once_cell::sync::Lazy; diff --git a/src/uucore/src/lib/features/encoding.rs b/src/uucore/src/lib/features/encoding.rs index db218d5f0..0ed54839d 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 89ffab7f4..3a23682c1 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 5384b52a1..37ed41137 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/features/utmpx.rs b/src/uucore/src/lib/features/utmpx.rs index 1b6ecbcf5..bdc3544b2 100644 --- a/src/uucore/src/lib/features/utmpx.rs +++ b/src/uucore/src/lib/features/utmpx.rs @@ -54,8 +54,6 @@ pub unsafe extern "C" fn utmpxname(_file: *const libc::c_char) -> libc::c_int { 0 } -use once_cell::sync::Lazy; - use crate::*; // import macros from `../../macros.rs` // In case the c_char array doesn't end with NULL diff --git a/src/uucore/src/lib/mods/error.rs b/src/uucore/src/lib/mods/error.rs index 82644ae8a..5720a6bef 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 7b659fc51..5cc0ba585 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;