We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
impl Iterator
Vec
1 parent 3c01125 commit 7ce4203Copy full SHA for 7ce4203
src/config.rs
@@ -364,12 +364,14 @@ impl Cfg {
364
Toolchain::from(self, name)
365
}
366
367
- pub fn get_toolchains_from_regex(&self, regex: Regex) -> Result<Vec<Toolchain<'_>>> {
+ pub fn get_toolchains_from_regex(
368
+ &self,
369
+ regex: Regex,
370
+ ) -> Result<impl Iterator<Item = Toolchain<'_>>> {
371
Ok(self
372
.list_toolchains_iter()?
- .filter(|toolchain| regex.is_match(toolchain))
- .map(|toolchain| Toolchain::from(self, &toolchain).unwrap())
- .collect())
373
+ .filter(move |toolchain| regex.is_match(toolchain))
374
+ .map(move |toolchain| Toolchain::from(self, &toolchain).unwrap()))
375
376
377
pub fn verify_toolchain(&self, name: &str) -> Result<Toolchain<'_>> {
0 commit comments