Skip to content

Commit 9d32b7b

Browse files
committed
Auto merge of #7836 - Mark-Simulacrum:clean-error, r=ehuss
Polish code to clarify meaning This preserves the same behavior, but the previous code looked like it might loop, but in fact never did.
2 parents 2a0f0c8 + de6c78c commit 9d32b7b

File tree

1 file changed

+6
-8
lines changed
  • src/cargo/core/compiler/context

1 file changed

+6
-8
lines changed

src/cargo/core/compiler/context/mod.rs

+6-8
Original file line numberDiff line numberDiff line change
@@ -504,14 +504,12 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
504504

505505
// Drain the client fully
506506
for i in 0..tokens {
507-
while let Err(e) = client.acquire_raw() {
508-
anyhow::bail!(
509-
"failed to fully drain {}/{} token from jobserver at startup: {:?}",
510-
i,
511-
tokens,
512-
e,
513-
);
514-
}
507+
client.acquire_raw().chain_err(|| {
508+
format!(
509+
"failed to fully drain {}/{} token from jobserver at startup",
510+
i, tokens,
511+
)
512+
})?;
515513
}
516514

517515
Ok(client)

0 commit comments

Comments
 (0)