Skip to content

Commit

Permalink
Remove noop functions in favor of conditional compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed Jun 13, 2024
1 parent cf63374 commit 0208b6d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 2 additions & 0 deletions src/cli/self_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ pub(crate) async fn install(
do_write_env_files()?;

if !opts.no_modify_path {
#[cfg(windows)]
do_add_to_programs()?;
do_add_to_path()?;
}
Expand Down Expand Up @@ -1022,6 +1023,7 @@ pub(crate) fn uninstall(no_prompt: bool) -> Result<utils::ExitCode> {

// Remove CARGO_HOME/bin from PATH
do_remove_from_path()?;
#[cfg(windows)]
do_remove_from_programs()?;

// Delete everything in CARGO_HOME *except* the rustup bin
Expand Down
8 changes: 0 additions & 8 deletions src/cli/self_update/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,6 @@ pub(crate) fn do_write_env_files() -> Result<()> {
Ok(())
}

pub(crate) fn do_add_to_programs() -> Result<()> {
Ok(())
}

pub(crate) fn do_remove_from_programs() -> Result<()> {
Ok(())
}

/// Tell the upgrader to replace the rustup bins, then delete
/// itself.
pub(crate) fn run_update(setup_path: &Path) -> Result<utils::ExitCode> {
Expand Down

0 comments on commit 0208b6d

Please sign in to comment.