From 733d0661e66d6e8281cc9d11837178c834a0a70b Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Mon, 6 Nov 2023 14:25:03 +0100 Subject: [PATCH] Inline channel pattern list --- src/dist/dist.rs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/dist/dist.rs b/src/dist/dist.rs index 9218abcc810..65e30d83d30 100644 --- a/src/dist/dist.rs +++ b/src/dist/dist.rs @@ -34,15 +34,6 @@ pub static DEFAULT_DIST_SERVER: &str = "https://static.rust-lang.org"; // Deprecated pub(crate) static DEFAULT_DIST_ROOT: &str = "https://static.rust-lang.org/dist"; -// The channel patterns we support -static TOOLCHAIN_CHANNELS: &[&str] = &[ - "nightly", - "beta", - "stable", - // Allow from 1.0.0 through to 9.999.99 with optional patch version - r"\d{1}\.\d{1,3}(?:\.\d{1,2})?", -]; - const TOOLSTATE_MSG: &str = "If you require these components, please install and use the latest successful build version,\n\ which you can find at .\n\nAfter determining \ @@ -187,7 +178,14 @@ impl FromStr for ParsedToolchainDesc { static TOOLCHAIN_CHANNEL_RE: Lazy = Lazy::new(|| { Regex::new(&format!( r"^({})(?:-(\d{{4}}-\d{{2}}-\d{{2}}))?(?:-(.+))?$", - TOOLCHAIN_CHANNELS.join("|") + [ // The channel patterns we support + "nightly", + "beta", + "stable", + // Allow from 1.0.0 through to 9.999.99 with optional patch version + r"\d{1}\.\d{1,3}(?:\.\d{1,2})?", + ] + .join("|") )) .unwrap() });