We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
/dist
RUSTUP_DIST_ROOT
1 parent 64ad614 commit 3b60eb2Copy full SHA for 3b60eb2
src/config.rs
@@ -1004,9 +1004,12 @@ pub(crate) fn dist_root_server(process: &Process) -> Result<String> {
1004
s
1005
}
1006
// For backwards compatibility
1007
- else if let Some(root) = non_empty_env_var("RUSTUP_DIST_ROOT", process)? {
+ else if let Some(mut root) = non_empty_env_var("RUSTUP_DIST_ROOT", process)? {
1008
trace!("`RUSTUP_DIST_ROOT` has been set to `{root}`");
1009
- root.trim_end_matches("/dist").to_owned()
+ if let Some(stripped) = root.strip_suffix("/dist") {
1010
+ root.truncate(stripped.len());
1011
+ }
1012
+ root
1013
} else {
1014
dist::DEFAULT_DIST_SERVER.to_owned()
1015
},
0 commit comments