Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ anstream = "1"
anstyle = "1.0.11"
anyhow = "1.0.69"
cc = "1"
cfg-if = "1.0"
chrono = { version = "0.4", default-features = false, features = ["std"] }
clap = { version = "4", features = ["derive", "wrap_help", "string"] }
clap-cargo = "0.18.3"
Expand Down
10 changes: 3 additions & 7 deletions src/bin/rustup-init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use std::process::ExitCode;

use anyhow::{Context, Result, anyhow};
use cfg_if::cfg_if;
// Public macros require availability of the internal symbols
use rs_tracing::{
close_trace_file, close_trace_file_internal, open_trace_file, trace_to_file_internal,
Expand Down Expand Up @@ -105,12 +104,9 @@ async fn run_rustup_inner(
Some(n) if n.starts_with("rustup-gc-") => {
// This is the final uninstallation stage on windows where
// rustup deletes its own exe
cfg_if! {
if #[cfg(windows)] {
self_update::complete_windows_uninstall(process)
} else {
unreachable!("Attempted to use Windows-specific code on a non-Windows platform. Aborting.")
}
cfg_select! {
windows => self_update::complete_windows_uninstall(process),
_ => unreachable!("Attempted to use Windows-specific code on a non-Windows platform. Aborting."),
}
}
Some(n) => {
Expand Down
10 changes: 3 additions & 7 deletions src/cli/self_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ use std::{fmt, fs};

use anstyle::Style;
use anyhow::{Context, Result, anyhow};
use cfg_if::cfg_if;
use clap::ValueEnum;
use clap::builder::PossibleValue;
use clap_cargo::style::{GOOD, WARN};
Expand Down Expand Up @@ -540,12 +539,9 @@ fn canonical_cargo_home(process: &Process) -> Result<Cow<'static, str>> {
.unwrap_or_else(|| PathBuf::from("."))
.join(".cargo");
Ok(if default_cargo_home == path {
cfg_if! {
if #[cfg(windows)] {
r"%USERPROFILE%\.cargo".into()
} else {
"$HOME/.cargo".into()
}
cfg_select! {
windows => r"%USERPROFILE%\.cargo".into(),
_ => "$HOME/.cargo".into(),
}
} else {
path.to_string_lossy().into_owned().into()
Expand Down
Loading