Skip to content

Commit de6c78c

Browse files
Polish code to clarify meaning
This preserves the same behavior, but the previous code looked like it might loop, but in fact never did.
1 parent 2a0f0c8 commit de6c78c

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)