mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-25 16:24:24 +00:00
Merge #470
470: Fix building on Rust 1.37 r=kvark a=kvark It doesn't like by-move pattern with an `if` Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
This commit is contained in:
commit
61d9e87c6b
@ -216,10 +216,14 @@ impl<S: ResourceState> ResourceTracker<S> {
|
||||
let (index, epoch, backend) = id.unzip();
|
||||
debug_assert_eq!(backend, self.backend);
|
||||
match self.map.entry(index) {
|
||||
Entry::Occupied(e) if e.get().ref_count.load() == 1 => {
|
||||
let res = e.remove();
|
||||
assert_eq!(res.epoch, epoch);
|
||||
true
|
||||
Entry::Occupied(e) => {
|
||||
if e.get().ref_count.load() == 1 {
|
||||
let res = e.remove();
|
||||
assert_eq!(res.epoch, epoch);
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
_ => false,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user