We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 79c0312 commit eda23b6Copy full SHA for eda23b6
src/rustup/lib.rs
@@ -39,7 +39,15 @@ pub static TOOLS: &'static [&'static str] = &[
39
pub static DUP_TOOLS: &'static [&'static str] = &["rustfmt", "cargo-fmt"];
40
41
fn component_for_bin(binary: &str) -> Option<&'static str> {
42
- match binary {
+ use std::env::consts::EXE_SUFFIX;
43
+
44
+ let binary_prefix = match binary.find(EXE_SUFFIX) {
45
+ _ if EXE_SUFFIX.is_empty() => binary,
46
+ Some(i) => &binary[..i],
47
+ None => binary,
48
+ };
49
50
+ match binary_prefix {
51
"rustc" | "rustdoc" => Some("rustc"),
52
"cargo" => Some("cargo"),
53
"rust-lldb" => Some("lldb-preview"),
0 commit comments