Use debug_assert! insetead of expect

This commit is contained in:
Agus Zubiaga 2024-11-23 11:17:12 -03:00
parent 5d6c47b25f
commit 5370a27370
No known key found for this signature in database

View file

@ -118,12 +118,8 @@ impl MonoTypes {
let opt = self.entries.get(id.inner.index());
#[cfg(debug_assertions)]
{
opt.expect("A MonoTypeId corresponded to an index that wasn't in MonoTypes. This should never happen!")
}
debug_assert!(opt.is_some(), "A MonoTypeId corresponded to an index that wasn't in MonoTypes. This should never happen!");
#[cfg(not(debug_assertions))]
unsafe {
opt.unwrap_unchecked()
}