Skip to content

Commit 4bd074e

Browse files
Use an expect instead of directly panicking
1 parent ec4cce9 commit 4bd074e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/cargo/core/compiler/job_queue.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -542,12 +542,12 @@ impl<'a, 'cfg> DrainState<'a, 'cfg> {
542542
// Note that this pops off potentially a completely
543543
// different token, but all tokens of the same job are
544544
// conceptually the same so that's fine.
545-
if let Some(rustc_tokens) = self.rustc_tokens.get_mut(&id) {
546-
self.tokens
547-
.push(rustc_tokens.pop().expect("rustc releases token it has"));
548-
} else {
549-
panic!("This job does not have tokens associated with it");
550-
}
545+
let rustc_tokens = self
546+
.rustc_tokens
547+
.get_mut(&id)
548+
.expect("no tokens associated");
549+
self.tokens
550+
.push(rustc_tokens.pop().expect("rustc releases token it has"));
551551
}
552552
}
553553

0 commit comments

Comments
 (0)