mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
Use an expect instead of directly panicking
This commit is contained in:
parent
ec4cce9f65
commit
4bd074e7a5
@ -542,12 +542,12 @@ impl<'a, 'cfg> DrainState<'a, 'cfg> {
|
||||
// Note that this pops off potentially a completely
|
||||
// different token, but all tokens of the same job are
|
||||
// conceptually the same so that's fine.
|
||||
if let Some(rustc_tokens) = self.rustc_tokens.get_mut(&id) {
|
||||
self.tokens
|
||||
.push(rustc_tokens.pop().expect("rustc releases token it has"));
|
||||
} else {
|
||||
panic!("This job does not have tokens associated with it");
|
||||
}
|
||||
let rustc_tokens = self
|
||||
.rustc_tokens
|
||||
.get_mut(&id)
|
||||
.expect("no tokens associated");
|
||||
self.tokens
|
||||
.push(rustc_tokens.pop().expect("rustc releases token it has"));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user