Skip to content

Commit

Permalink
Auto merge of #7836 - Mark-Simulacrum:clean-error, r=ehuss
Browse files Browse the repository at this point in the history
Polish code to clarify meaning

This preserves the same behavior, but the previous code looked like it might
loop, but in fact never did.
  • Loading branch information
bors committed Jan 26, 2020
2 parents 2a0f0c8 + de6c78c commit 9d32b7b
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/cargo/core/compiler/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,14 +504,12 @@ impl<'a, 'cfg> Context<'a, 'cfg> {

// Drain the client fully
for i in 0..tokens {
while let Err(e) = client.acquire_raw() {
anyhow::bail!(
"failed to fully drain {}/{} token from jobserver at startup: {:?}",
i,
tokens,
e,
);
}
client.acquire_raw().chain_err(|| {
format!(
"failed to fully drain {}/{} token from jobserver at startup",
i, tokens,
)
})?;
}

Ok(client)
Expand Down

0 comments on commit 9d32b7b

Please sign in to comment.