Skip to content

Commit fe99f78

Browse files
djcrami3l
authored andcommitted
Reorder operations in order to simplify
1 parent a755846 commit fe99f78

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/config.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use std::borrow::Cow;
21
use std::fmt::{self, Debug, Display};
32
use std::path::{Path, PathBuf};
43
use std::str::FromStr;
@@ -303,9 +302,9 @@ impl<'a> Cfg<'a> {
303302
// For backward compatibility
304303
non_empty_env_var("RUSTUP_DIST_ROOT", process)?
305304
.inspect(|url| trace!("`RUSTUP_DIST_ROOT` has been set to `{url}`"))
306-
.map_or(Cow::Borrowed(dist::DEFAULT_DIST_ROOT), Cow::Owned)
307305
.as_ref()
308-
.trim_end_matches("/dist")
306+
.map(|root| root.trim_end_matches("/dist"))
307+
.unwrap_or(dist::DEFAULT_DIST_SERVER)
309308
.to_owned()
310309
}
311310
};

src/dist/mod.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ pub(crate) use triple::*;
4141

4242
pub static DEFAULT_DIST_SERVER: &str = "https://static.rust-lang.org";
4343

44-
// Deprecated
45-
pub(crate) static DEFAULT_DIST_ROOT: &str = "https://static.rust-lang.org/dist";
46-
4744
const TOOLSTATE_MSG: &str =
4845
"If you require these components, please install and use the latest successful build version,\n\
4946
which you can find at <https://rust-lang.github.io/rustup-components-history>.\n\nAfter determining \

0 commit comments

Comments
 (0)