From 525703358bf52b74a01d9b0c04680d33621d60cd Mon Sep 17 00:00:00 2001 From: datdenkikniet Date: Sat, 15 Apr 2023 12:21:11 +0200 Subject: Rework command execution structure and make rayon optional (since it's not necessarily faster due to workspace wide lockfile contention) --- xtask/src/argument_parsing.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'xtask/src/argument_parsing.rs') diff --git a/xtask/src/argument_parsing.rs b/xtask/src/argument_parsing.rs index 7284fc5..e653f9a 100644 --- a/xtask/src/argument_parsing.rs +++ b/xtask/src/argument_parsing.rs @@ -275,12 +275,22 @@ pub struct PackageOpt { } impl PackageOpt { + #[cfg(not(feature = "rayon"))] pub fn packages(&self) -> impl Iterator { self.package .map(|p| vec![p]) .unwrap_or(Package::all()) .into_iter() } + + #[cfg(feature = "rayon")] + pub fn packages(&self) -> impl rayon::prelude::ParallelIterator { + use rayon::prelude::*; + self.package + .map(|p| vec![p]) + .unwrap_or(Package::all()) + .into_par_iter() + } } #[derive(Args, Debug, Clone)] -- cgit v1.2.3