Skip to content

Commit

Permalink
Polish code to clarify meaning
Browse files Browse the repository at this point in the history
This preserves the same behavior, but the previous code looked like it might
loop, but in fact never did.
  • Loading branch information
Mark-Simulacrum committed Jan 26, 2020
1 parent 2a0f0c8 commit de6c78c
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 de6c78c

Please sign in to comment.