diff --git a/wgpu-native/src/hub.rs b/wgpu-native/src/hub.rs index 07028a34b0..0c106d89ab 100644 --- a/wgpu-native/src/hub.rs +++ b/wgpu-native/src/hub.rs @@ -97,7 +97,7 @@ impl ops::Index for Storage { type Output = T; fn index(&self, id: I) -> &T { let (ref value, epoch) = self.map[id.index() as usize]; - assert_eq!(epoch, id.index()); + assert_eq!(epoch, id.epoch()); value } } @@ -105,7 +105,7 @@ impl ops::Index for Storage { impl ops::IndexMut for Storage { fn index_mut(&mut self, id: I) -> &mut T { let (ref mut value, epoch) = self.map[id.index() as usize]; - assert_eq!(epoch, id.index()); + assert_eq!(epoch, id.epoch()); value } } @@ -113,7 +113,7 @@ impl ops::IndexMut for Storage { impl Storage { pub fn contains(&self, id: I) -> bool { match self.map.get(id.index() as usize) { - Some(&(_, epoch)) if epoch == id.index() => true, + Some(&(_, epoch)) if epoch == id.epoch() => true, _ => false, } }