Skip to content

Commit 2dc6dd7

Browse files
epagerami3l
authored andcommitted
style: Remove wildcard imports
This is based on review feedback from #4551. I experimented with a `clippy.toml` file for "blessing" some of these, like `errors`, but for some reason I wasn't able to get it to work.
1 parent c5839b9 commit 2dc6dd7

File tree

15 files changed

+37
-23
lines changed

15 files changed

+37
-23
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ unused_qualifications = "warn"
152152
# `dbg!()` and `todo!()` clearly shouldn't make it to production:
153153
dbg_macro = "warn"
154154
todo = "warn"
155+
wildcard_imports = "warn"
155156

156157
[lib]
157158
name = "rustup"

src/cli/job.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,13 @@ mod imp {
4141
use std::ptr;
4242

4343
use tracing::info;
44-
use windows_sys::Win32::Foundation::*;
45-
use windows_sys::Win32::System::JobObjects::*;
46-
use windows_sys::Win32::System::Threading::*;
44+
use windows_sys::Win32::Foundation::{CloseHandle, HANDLE};
45+
use windows_sys::Win32::System::JobObjects::{
46+
AssignProcessToJobObject, CreateJobObjectW, JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE,
47+
JOBOBJECT_EXTENDED_LIMIT_INFORMATION, JobObjectExtendedLimitInformation,
48+
SetInformationJobObject,
49+
};
50+
use windows_sys::Win32::System::Threading::GetCurrentProcess;
4751

4852
pub(crate) struct Setup {
4953
job: Handle,

src/cli/rustup_mode.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,13 @@ use crate::{
2727
cli::{
2828
common::{self, PackageUpdate, update_console_filter},
2929
errors::CliError,
30-
help::*,
30+
help::{
31+
completions_help, default_help, doc_help, install_help,
32+
maybe_resolvable_toolchain_arg_help, official_toolchain_arg_help, override_help,
33+
override_unset_help, resolvable_local_toolchain_arg_help,
34+
resolvable_toolchain_arg_help, run_help, rustup_help, show_active_toolchain_help,
35+
show_help, toolchain_help, toolchain_link_help, topic_arg_help, update_help,
36+
},
3137
self_update::{self, SelfUpdateMode, check_rustup_update},
3238
topical_doc,
3339
},

src/cli/self_update.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ use crate::{
5555
DUP_TOOLS, TOOLS,
5656
cli::{
5757
common::{self, Confirm, PackageUpdate, ignorable_error, report_error},
58-
errors::*,
58+
errors::CliError,
5959
markdown::md,
6060
},
6161
config::Cfg,

src/cli/self_update/windows.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use windows_registry::{CURRENT_USER, HSTRING, Key};
1616
use windows_result::HRESULT;
1717
use windows_sys::Win32::Foundation::{ERROR_FILE_NOT_FOUND, ERROR_INVALID_DATA};
1818

19-
use super::super::errors::*;
19+
use super::super::errors::CliError;
2020
use super::common;
2121
use super::{InstallOpts, install_bins, report_error};
2222
use crate::cli::markdown::md;
@@ -460,7 +460,7 @@ pub(crate) fn do_add_to_path(process: &Process) -> Result<()> {
460460

461461
fn _apply_new_path(new_path: Option<HSTRING>) -> Result<()> {
462462
use std::ptr;
463-
use windows_sys::Win32::Foundation::*;
463+
use windows_sys::Win32::Foundation::{LPARAM, WPARAM};
464464
use windows_sys::Win32::UI::WindowsAndMessaging::{
465465
HWND_BROADCAST, SMTO_ABORTIFHUNG, SendMessageTimeoutA, WM_SETTINGCHANGE,
466466
};

src/dist/component/package.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ use tar::EntryType;
1414
use tracing::{error, trace, warn};
1515

1616
use crate::diskio::{CompletedIo, Executor, FileBuffer, IO_CHUNK_SIZE, Item, Kind, get_executor};
17-
use crate::dist::component::components::*;
18-
use crate::dist::component::transaction::*;
17+
use crate::dist::component::components::{ComponentPart, ComponentPartKind, Components};
18+
use crate::dist::component::transaction::Transaction;
1919
use crate::dist::download::DownloadCfg;
2020
use crate::dist::temp;
21-
use crate::errors::*;
21+
use crate::errors::RustupError;
2222
use crate::utils;
2323
use crate::utils::units::Size;
2424

src/dist/component/transaction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use tracing::{error, info};
1717

1818
use crate::dist::prefix::InstallPrefix;
1919
use crate::dist::temp;
20-
use crate::errors::*;
20+
use crate::errors::RustupError;
2121
use crate::process::Process;
2222
use crate::utils;
2323

src/dist/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use anyhow::{Context, Result};
55
use serde::{Deserialize, Serialize};
66

77
use super::manifest::Component;
8-
use crate::errors::*;
8+
use crate::errors::RustupError;
99

1010
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1111
pub struct Config {

src/dist/download.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use url::Url;
1414
use crate::config::Cfg;
1515
use crate::dist::temp;
1616
use crate::download::{download_file, download_file_with_resume};
17-
use crate::errors::*;
17+
use crate::errors::RustupError;
1818
use crate::process::Process;
1919
use crate::utils;
2020

src/dist/manifest.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use serde::{Deserialize, Serialize};
2323

2424
use crate::{
2525
dist::{Profile, TargetTriple, ToolchainDesc, config::Config},
26-
errors::*,
26+
errors::RustupError,
2727
toolchain::DistributableToolchain,
2828
};
2929

@@ -249,7 +249,7 @@ impl Hash for Component {
249249
}
250250

251251
mod component_target {
252-
use super::*;
252+
use super::{Result, TargetTriple};
253253
use serde::{Deserialize, Deserializer, Serializer};
254254

255255
pub fn serialize<S: Serializer>(

0 commit comments

Comments
 (0)