Skip to content

Commit 8cbc7b4

Browse files
authored
chore: clippy::wildcard_imports (#10719)
* [`clippy::wildcard_imports`](https://rust-lang.github.io/rust-clippy/master/index.html?search=wildcard_imports#wildcard_imports) Usually wildcards lead to less certain code, so best to avoid it.
1 parent 01f3e32 commit 8cbc7b4

File tree

16 files changed

+37
-19
lines changed

16 files changed

+37
-19
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,6 @@ unnecessary_wraps = "allow" # 33
673673
ignored_unit_patterns = "allow" # 21
674674
similar_names = "allow" # 20
675675
large_stack_arrays = "allow" # 20
676-
wildcard_imports = "allow" # 18
677676
needless_pass_by_value = "allow" # 16
678677
float_cmp = "allow" # 12
679678
items_after_statements = "allow" # 11

src/uu/arch/src/arch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// file that was distributed with this source code.
55

66
use clap::Command;
7-
use platform_info::*;
7+
use platform_info::{PlatformInfo, PlatformInfoAPI, UNameAPI};
88
use std::io::{Write, stdout};
99
use uucore::error::{UResult, USimpleError};
1010
use uucore::translate;

src/uu/chcon/src/chcon.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use std::{fs, io};
2525
mod errors;
2626
mod fts;
2727

28-
use errors::*;
28+
use errors::{Error, Result, report_full_error};
2929

3030
pub mod options {
3131
pub static HELP: &str = "help";

src/uu/dd/src/datastructures.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// file that was distributed with this source code.
55
// spell-checker:ignore ctable, outfile, iseek, oseek
66

7-
use crate::conversion_tables::*;
7+
use crate::conversion_tables::ConversionTable;
88

99
type Cbs = usize;
1010

src/uu/dd/src/dd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ mod progress;
1515

1616
use crate::bufferedoutput::BufferedOutput;
1717
use blocks::conv_block_unblock_helper;
18-
use datastructures::*;
18+
use datastructures::{ConversionMode, IConvFlags, IFlags, OConvFlags, OFlags, options};
1919
#[cfg(any(target_os = "linux", target_os = "android"))]
2020
use nix::fcntl::FcntlArg;
2121
#[cfg(any(target_os = "linux", target_os = "android"))]

src/uu/dd/src/parseargs.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,9 @@ fn get_ctable(
541541
conversion: Option<Conversion>,
542542
case: Option<Case>,
543543
) -> Option<&'static ConversionTable> {
544+
#[allow(clippy::wildcard_imports)]
544545
use crate::conversion_tables::*;
546+
545547
Some(match (conversion, case) {
546548
(None, None) => return None,
547549
(Some(conv), None) => match conv {

src/uu/dd/src/progress.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ impl SignalHandler {
460460
pub(crate) fn install_signal_handler(
461461
f: Box<dyn Send + Sync + Fn()>,
462462
) -> Result<Self, std::io::Error> {
463-
use signal_hook::consts::signal::*;
463+
use signal_hook::consts::signal::SIGUSR1;
464464
use signal_hook::iterator::Signals;
465465

466466
let mut signals = Signals::new([SIGUSR1])?;

src/uu/numfmt/src/numfmt.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@
33
// For the full copyright and license information, please view the LICENSE
44
// file that was distributed with this source code.
55

6-
use crate::errors::*;
6+
use crate::errors::NumfmtError;
77
use crate::format::{format_and_print_delimited, format_and_print_whitespace};
8-
use crate::options::*;
8+
use crate::options::{
9+
DEBUG, DELIMITER, FIELD, FIELD_DEFAULT, FORMAT, FROM, FROM_DEFAULT, FROM_UNIT,
10+
FROM_UNIT_DEFAULT, FormatOptions, HEADER, HEADER_DEFAULT, INVALID, InvalidModes, NUMBER,
11+
NumfmtOptions, PADDING, ROUND, RoundMethod, SUFFIX, TO, TO_DEFAULT, TO_UNIT, TO_UNIT_DEFAULT,
12+
TransformOptions, UNIT_SEPARATOR, ZERO_TERMINATED,
13+
};
914
use crate::units::{Result, Unit};
1015
use clap::{Arg, ArgAction, ArgMatches, Command, builder::ValueParser, parser::ValueSource};
1116
use std::ffi::OsString;

src/uu/od/src/parse_formats.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,16 @@ use uucore::display::Quotable;
88
use uucore::translate;
99

1010
use crate::formatter_item_info::FormatterItemInfo;
11-
use crate::prn_char::*;
12-
use crate::prn_float::*;
13-
use crate::prn_int::*;
11+
use crate::prn_char::{FORMAT_ITEM_A, FORMAT_ITEM_C};
12+
use crate::prn_float::{
13+
FORMAT_ITEM_BF16, FORMAT_ITEM_F16, FORMAT_ITEM_F32, FORMAT_ITEM_F64, FORMAT_ITEM_LONG_DOUBLE,
14+
};
15+
use crate::prn_int::{
16+
FORMAT_ITEM_DEC8S, FORMAT_ITEM_DEC8U, FORMAT_ITEM_DEC16S, FORMAT_ITEM_DEC16U,
17+
FORMAT_ITEM_DEC32S, FORMAT_ITEM_DEC32U, FORMAT_ITEM_DEC64S, FORMAT_ITEM_DEC64U,
18+
FORMAT_ITEM_HEX8, FORMAT_ITEM_HEX16, FORMAT_ITEM_HEX32, FORMAT_ITEM_HEX64, FORMAT_ITEM_OCT8,
19+
FORMAT_ITEM_OCT16, FORMAT_ITEM_OCT32, FORMAT_ITEM_OCT64,
20+
};
1421

1522
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
1623
pub struct ParsedFormatterItemInfo {

src/uu/od/src/prn_int.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// For the full copyright and license information, please view the LICENSE
44
// file that was distributed with this source code.
5-
use crate::formatter_item_info::*;
5+
use crate::formatter_item_info::{FormatWriter, FormatterItemInfo};
66

77
/// format string to print octal using `int_writer_unsigned`
88
macro_rules! OCT {

0 commit comments

Comments
 (0)