Skip to content

Commit 5af4bc4

Browse files
committed
Inline channel pattern list
1 parent 68fbf3f commit 5af4bc4

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/dist/dist.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,6 @@ pub static DEFAULT_DIST_SERVER: &str = "https://static.rust-lang.org";
3434
// Deprecated
3535
pub(crate) static DEFAULT_DIST_ROOT: &str = "https://static.rust-lang.org/dist";
3636

37-
// The channel patterns we support
38-
static TOOLCHAIN_CHANNELS: &[&str] = &[
39-
"nightly",
40-
"beta",
41-
"stable",
42-
// Allow from 1.0.0 through to 9.999.99 with optional patch version
43-
r"\d{1}\.\d{1,3}(?:\.\d{1,2})?",
44-
];
45-
4637
const TOOLSTATE_MSG: &str =
4738
"If you require these components, please install and use the latest successful build version,\n\
4839
which you can find at <https://rust-lang.github.io/rustup-components-history>.\n\nAfter determining \
@@ -187,7 +178,15 @@ impl FromStr for ParsedToolchainDesc {
187178
static TOOLCHAIN_CHANNEL_RE: Lazy<Regex> = Lazy::new(|| {
188179
Regex::new(&format!(
189180
r"^({})(?:-(\d{{4}}-\d{{2}}-\d{{2}}))?(?:-(.+))?$",
190-
TOOLCHAIN_CHANNELS.join("|")
181+
// The channel patterns we support
182+
[
183+
"nightly",
184+
"beta",
185+
"stable",
186+
// Allow from 1.0.0 through to 9.999.99 with optional patch version
187+
r"\d{1}\.\d{1,3}(?:\.\d{1,2})?",
188+
]
189+
.join("|")
191190
))
192191
.unwrap()
193192
});

0 commit comments

Comments
 (0)