Rollup merge of #122378 - clubby789:rustbook-rebuild, r=onur-ozkan

Properly rebuild rustbooks

Fixes #122367

If the book was out of date but the tool was up to date, this would evaluate to `!(false || true)` == `!true` == `false` and not rebuild.
This commit is contained in:
Jubilee 2024-03-12 09:04:03 -07:00 committed by GitHub
commit cf3d178e2d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -145,7 +145,8 @@ fn run(self, builder: &Builder<'_>) {
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))
if !builder.config.dry_run()
&& (!up_to_date(&src, &index) || !up_to_date(&rustbook, &index))
{
builder.info(&format!("Rustbook ({target}) - {name}"));
let _ = fs::remove_dir_all(&out);