From 8ee18d600f962df67e831da4d07cc556cff39526 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Sun, 7 Jul 2024 13:28:14 +0200 Subject: [PATCH] Fix a case where a RustBook command is potentially not executed We can move the command creation to a block where it is clear that the command will be executed. --- src/bootstrap/src/core/build_steps/doc.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/doc.rs b/src/bootstrap/src/core/build_steps/doc.rs index 4b35d6c5d4c9..d1080775efe5 100644 --- a/src/bootstrap/src/core/build_steps/doc.rs +++ b/src/bootstrap/src/core/build_steps/doc.rs @@ -146,7 +146,6 @@ impl Step for RustbookSrc

{ let out = out.join(&name); let index = out.join("index.html"); let rustbook = builder.tool_exe(Tool::Rustbook); - let mut rustbook_cmd = builder.tool_cmd(Tool::Rustbook); if !builder.config.dry_run() && (!up_to_date(&src, &index) || !up_to_date(&rustbook, &index)) @@ -154,7 +153,13 @@ impl Step for RustbookSrc

{ builder.info(&format!("Rustbook ({target}) - {name}")); let _ = fs::remove_dir_all(&out); - rustbook_cmd.arg("build").arg(&src).arg("-d").arg(&out).run(builder); + builder + .tool_cmd(Tool::Rustbook) + .arg("build") + .arg(&src) + .arg("-d") + .arg(&out) + .run(builder); for lang in &self.languages { let out = out.join(lang);