You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let final_path:Option<String> = ifis_valid_executable(executable_name){
37
-
Some(executable_name.to_owned())
38
-
}else{
39
-
ifletSome(mut path) = dirs::home_dir(){
40
-
path.push(".cargo");
41
-
path.push("bin");
42
-
path.push(executable_name);
43
-
ifis_valid_executable(&path){
44
-
Some(path.into_os_string().into_string().expect("Invalid Unicode in path"))
45
-
}else{
46
-
None
47
-
}
48
-
}else{
49
-
None
36
+
ifis_valid_executable(executable_name){
37
+
returnOk(executable_name.to_owned());
38
+
}
39
+
ifletSome(mut path) = dirs::home_dir(){
40
+
path.push(".cargo");
41
+
path.push("bin");
42
+
path.push(executable_name);
43
+
ifis_valid_executable(&path){
44
+
returnOk(path.into_os_string().into_string().expect("Invalid Unicode in path"));
50
45
}
51
-
};
52
-
final_path.ok_or(
53
-
// This error message may also be caused by $PATH or $CARGO/$RUSTC/etc not being set correctly
54
-
// for VSCode, even if they are set correctly in a terminal.
55
-
// On macOS in particular, launching VSCode from terminal with `code <dirname>` causes VSCode
56
-
// to inherit environment variables including $PATH, $CARGO, $RUSTC, etc from that terminal;
57
-
// but launching VSCode from Dock does not inherit environment variables from a terminal.
58
-
// For more discussion, see #3118.
59
-
Error::msg(format!("Failed to find `{}` executable. Make sure `{}` is in `$PATH`, or set `${}` to point to a valid executable.", executable_name, executable_name, env_var))
60
-
)
46
+
}
47
+
// This error message may also be caused by $PATH or $CARGO/$RUSTC/etc not being set correctly
48
+
// for VSCode, even if they are set correctly in a terminal.
49
+
// On macOS in particular, launching VSCode from terminal with `code <dirname>` causes VSCode
50
+
// to inherit environment variables including $PATH, $CARGO, $RUSTC, etc from that terminal;
51
+
// but launching VSCode from Dock does not inherit environment variables from a terminal.
52
+
// For more discussion, see #3118.
53
+
Err(Error::msg(format!("Failed to find `{}` executable. Make sure `{}` is in `$PATH`, or set `${}` to point to a valid executable.", executable_name, executable_name, env_var)))
0 commit comments