From 0ee2d2c2dbd794dd5f77281de3368c22ea4e7e33 Mon Sep 17 00:00:00 2001 From: datdenkikniet Date: Sun, 16 Apr 2023 13:27:54 +0200 Subject: [PATCH] Actually chain these --- xtask/src/run.rs | 51 ++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/xtask/src/run.rs b/xtask/src/run.rs index 74179c56fd..13d2e22ee5 100644 --- a/xtask/src/run.rs +++ b/xtask/src/run.rs @@ -418,35 +418,34 @@ pub fn build_and_check_size<'c>( let target = backend.to_target(); let features = Some(target.and_features(backend.to_rtic_feature())); - let runner = into_iter(examples).map(|example| { - let target = target.into(); + let runner = into_iter(examples) + .flat_map(|example| { + let target = target.into(); - // Make sure the requested example(s) are built - let cmd = CargoCommand::ExampleBuild { - cargoarg: &Some("--quiet"), - example, - target, - features: features.clone(), - mode: BuildMode::Release, - dir: Some(PathBuf::from("./rtic")), - deny_warnings: globals.deny_warnings, - }; + // Make sure the requested example(s) are built + let cmd_build = CargoCommand::ExampleBuild { + cargoarg: &Some("--quiet"), + example, + target, + features: features.clone(), + mode: BuildMode::Release, + dir: Some(PathBuf::from("./rtic")), + deny_warnings: globals.deny_warnings, + }; - if let Err(err) = command_parser(globals, &cmd, false) { - error!("{err}"); - } + let cmd_size = CargoCommand::ExampleSize { + cargoarg, + example, + target, + features: features.clone(), + mode: BuildMode::Release, + arguments: arguments.clone(), + dir: Some(PathBuf::from("./rtic")), + }; - let cmd = CargoCommand::ExampleSize { - cargoarg, - example, - target, - features: features.clone(), - mode: BuildMode::Release, - arguments: arguments.clone(), - dir: Some(PathBuf::from("./rtic")), - }; - (globals, cmd, false) - }); + [cmd_build, cmd_size] + }) + .map(|cmd| (globals, cmd, false)); runner.run_and_coalesce() }