From c39c73006d9f954cb9b52285a9cd598f65b896b7 Mon Sep 17 00:00:00 2001 From: Camelid Date: Wed, 28 Oct 2020 13:49:53 -0700 Subject: [PATCH] Return `impl Iterator` instead of `Vec` --- src/config.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/config.rs b/src/config.rs index f08a9aac19b..e00095d3caa 100644 --- a/src/config.rs +++ b/src/config.rs @@ -364,12 +364,14 @@ impl Cfg { Toolchain::from(self, name) } - pub fn get_toolchains_from_regex(&self, regex: Regex) -> Result>> { + pub fn get_toolchains_from_regex( + &self, + regex: Regex, + ) -> Result>> { Ok(self .list_toolchains_iter()? .filter(|toolchain| regex.is_match(toolchain)) - .map(|toolchain| Toolchain::from(self, &toolchain).unwrap()) - .collect()) + .map(|toolchain| Toolchain::from(self, &toolchain).unwrap())) } pub fn verify_toolchain(&self, name: &str) -> Result> {