From 859cd418f063590a9928b3e43caeea0b53dc0823 Mon Sep 17 00:00:00 2001 From: datdenkikniet Date: Sat, 15 Apr 2023 20:57:27 +0200 Subject: [PATCH] Rename some things --- xtask/src/argument_parsing.rs | 8 ++++---- xtask/src/command.rs | 6 +++--- xtask/src/main.rs | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/xtask/src/argument_parsing.rs b/xtask/src/argument_parsing.rs index d74ba69f8f..6cae186edc 100644 --- a/xtask/src/argument_parsing.rs +++ b/xtask/src/argument_parsing.rs @@ -304,24 +304,24 @@ pub enum Commands { /// Check one or more usage examples. /// /// Usage examples are located in ./examples - UsageExamplesCheck(UsageExamples), + UsageExampleCheck(UsageExamplesOpt), /// Build one or more usage examples. /// /// Usage examples are located in ./examples #[clap(alias = "./examples")] - UsageExampleBuild(UsageExamples), + UsageExampleBuild(UsageExamplesOpt), } #[derive(Args, Clone, Debug)] -pub struct UsageExamples { +pub struct UsageExamplesOpt { /// The usage examples to build. All usage examples are selected if this argument is not provided. /// /// Example: `rp2040_local_i2c_init,stm32f3_blinky`. examples: Option, } -impl UsageExamples { +impl UsageExamplesOpt { pub fn examples(&self) -> anyhow::Result> { let usage_examples: Vec<_> = std::fs::read_dir("./examples")? .filter_map(Result::ok) diff --git a/xtask/src/command.rs b/xtask/src/command.rs index 93ea824551..a1c4d2533b 100644 --- a/xtask/src/command.rs +++ b/xtask/src/command.rs @@ -831,16 +831,16 @@ pub fn handle_results(globals: &Globals, results: Vec) -> Result }; if globals.verbose > 0 { - info!("✅ Success:{path} {cmd}\n {}", cmd.as_cmd_string()); + info!("✅ Success: {cmd}{path}\n {}", cmd.as_cmd_string()); } else { - info!("✅ Success:{path} {cmd}"); + info!("✅ Success:{cmd}{path}"); } }); errors.clone().for_each(|(cmd, _, _)| { if let Some(dir) = cmd.chdir() { let path = dir.as_os_str().to_str().unwrap_or("Not displayable"); - error!("❌ Failed: (in {path}) {cmd}\n {}", cmd.as_cmd_string()); + error!("❌ Failed: {cmd} (in {path}) \n {}", cmd.as_cmd_string()); } else { error!("❌ Failed: {cmd}\n {}", cmd.as_cmd_string()); } diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 4cf6db8aae..10499c022c 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -288,7 +288,7 @@ fn main() -> anyhow::Result<()> { info!("Running mdbook"); cargo_book(globals, &args.arguments) } - Commands::UsageExamplesCheck(examples) => { + Commands::UsageExampleCheck(examples) => { info!("Checking usage examples"); cargo_usage_example(globals, BuildOrCheck::Check, examples.examples()?) }