mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-21 22:33:49 +00:00
Panic on non-existent entry in Storage.get
, this is consistent with Element::Vacant
This commit is contained in:
parent
16c7d84d63
commit
896418c740
@ -98,9 +98,8 @@ where
|
||||
let (index, epoch, _) = id.unzip();
|
||||
let (result, storage_epoch) = match self.map.get(index as usize) {
|
||||
Some(&Element::Occupied(ref v, epoch)) => (Ok(v), epoch),
|
||||
Some(&Element::Vacant) => panic!("{}[{:?}] does not exist", self.kind, id),
|
||||
None | Some(&Element::Vacant) => panic!("{}[{:?}] does not exist", self.kind, id),
|
||||
Some(&Element::Error(epoch)) => (Err(InvalidId), epoch),
|
||||
None => return Err(InvalidId),
|
||||
};
|
||||
assert_eq!(
|
||||
epoch, storage_epoch,
|
||||
|
Loading…
Reference in New Issue
Block a user