Skip to content

Commit

Permalink
Merge pull request #5988 from cakebaker/fix_imported_redundantly_warn…
Browse files Browse the repository at this point in the history
…ings

Fix "item x imported redundantly" warnings
  • Loading branch information
sylvestre committed Feb 20, 2024
2 parents 177ac7e + 725da98 commit 4dba45d
Show file tree
Hide file tree
Showing 17 changed files with 7 additions and 29 deletions.
1 change: 0 additions & 1 deletion src/uu/cp/src/cp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/uu/env/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/uu/join/src/join.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 1 addition & 3 deletions src/uu/od/src/multifilereader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/uu/pr/src/pr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
1 change: 0 additions & 1 deletion src/uu/ptx/src/ptx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/uu/sleep/src/sleep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
1 change: 0 additions & 1 deletion src/uu/stat/src/stat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
1 change: 0 additions & 1 deletion src/uu/timeout/src/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
1 change: 0 additions & 1 deletion src/uu/wc/src/utf8/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<B: BufRead> {
Expand Down
1 change: 0 additions & 1 deletion src/uucore/src/lib/features/backup_control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 1 addition & 3 deletions src/uucore/src/lib/features/encoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions src/uucore/src/lib/features/fsext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
10 changes: 3 additions & 7 deletions src/uucore/src/lib/features/perms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions src/uucore/src/lib/features/utmpx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/uucore/src/lib/mods/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@

// spell-checker:ignore uioerror rustdoc

use clap;
use std::{
error::Error,
fmt::{Display, Formatter},
Expand Down
2 changes: 1 addition & 1 deletion tests/by-util/test_touch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 4dba45d

Please sign in to comment.