mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
fixes hub.rs
This commit is contained in:
@@ -97,7 +97,7 @@ impl<T, I:TypedId> ops::Index<I> for Storage<T, I> {
|
||||
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<T, I:TypedId> ops::Index<I> for Storage<T, I> {
|
||||
impl<T, I:TypedId> ops::IndexMut<I> for Storage<T, I> {
|
||||
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<T, I:TypedId> ops::IndexMut<I> for Storage<T, I> {
|
||||
impl<T, I:TypedId> Storage<T, I> {
|
||||
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,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user