From 8bec172129437ceec0300bdca489a107d1a97f0a Mon Sep 17 00:00:00 2001 From: hi-rustin Date: Tue, 27 Apr 2021 23:37:11 +0800 Subject: [PATCH 1/2] Add DUP_TOOLS as supported arg0 --- src/bin/rustup-init.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bin/rustup-init.rs b/src/bin/rustup-init.rs index a7085361db..6aaa79f3dd 100644 --- a/src/bin/rustup-init.rs +++ b/src/bin/rustup-init.rs @@ -28,7 +28,7 @@ use rustup::cli::setup_mode; use rustup::currentprocess::{process, with, OSProcess}; use rustup::env_var::RUST_RECURSION_COUNT_MAX; use rustup::utils::utils; -use rustup::TOOLS; +use rustup::{TOOLS, DUP_TOOLS}; fn main() { let process = OSProcess::default(); @@ -67,7 +67,7 @@ fn run_rustup_inner() -> Result { Ok(v) => Some(v), Err(_) => process().args().next(), } - .map(PathBuf::from); + .map(PathBuf::from); let name = arg0 .as_ref() .and_then(|a| a.file_stem()) @@ -94,7 +94,7 @@ fn run_rustup_inner() -> Result { } } Some(n) => { - if TOOLS.iter().find(|&&name| name == n).is_some() { + if TOOLS.iter().chain(DUP_TOOLS.iter()).find(|&&name| name == n).is_some() { proxy_mode::main() } else { Err(ErrorKind::UnknownProxyName(n.to_string()).into()) From 3b95226efa2e2525ce8002b36016f67305d20be1 Mon Sep 17 00:00:00 2001 From: hi-rustin Date: Tue, 27 Apr 2021 23:39:29 +0800 Subject: [PATCH 2/2] Fmt code --- src/bin/rustup-init.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/rustup-init.rs b/src/bin/rustup-init.rs index 6aaa79f3dd..bde4df542a 100644 --- a/src/bin/rustup-init.rs +++ b/src/bin/rustup-init.rs @@ -67,7 +67,7 @@ fn run_rustup_inner() -> Result { Ok(v) => Some(v), Err(_) => process().args().next(), } - .map(PathBuf::from); + .map(PathBuf::from); let name = arg0 .as_ref() .and_then(|a| a.file_stem())