From b9e7449b437078f30783cb4b0645cae22a3d4adf Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Wed, 22 Jan 2020 19:48:32 -0500 Subject: [PATCH] Fix building on Rust 1.37 It doesn't like by-move pattern with an `if` --- wgpu-core/src/track/mod.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/wgpu-core/src/track/mod.rs b/wgpu-core/src/track/mod.rs index fdbf96249..5116d9c40 100644 --- a/wgpu-core/src/track/mod.rs +++ b/wgpu-core/src/track/mod.rs @@ -216,10 +216,14 @@ impl ResourceTracker { 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, }