diff --git a/src/cli/rustup_mode.rs b/src/cli/rustup_mode.rs index 195d6482ee..f5f17bbe87 100644 --- a/src/cli/rustup_mode.rs +++ b/src/cli/rustup_mode.rs @@ -7,6 +7,7 @@ use std::process::Command; use std::str::FromStr; use clap::{App, AppSettings, Arg, ArgGroup, ArgMatches, Shell, SubCommand}; +use regex::Regex; use super::common; use super::errors::*; @@ -1324,7 +1325,7 @@ fn toolchain_remove(cfg: &mut Cfg, m: &ArgMatches<'_>) -> Result Result>> { + pub fn get_toolchains_from_regex(&self, regex: Regex) -> Result>> { Ok(self .list_toolchains_iter()? .filter(|toolchain| regex.is_match(toolchain))