From 6b00ebf94dea43bc5cda00a46224d1d76d0481cb Mon Sep 17 00:00:00 2001 From: Greg V Date: Tue, 24 Nov 2020 18:58:52 +0300 Subject: [PATCH] [rs] Staging belt: do not panic by unwrapping send result in recall (fixes #634) --- wgpu/src/util/belt.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wgpu/src/util/belt.rs b/wgpu/src/util/belt.rs index 7c4662406d..251d6483b7 100644 --- a/wgpu/src/util/belt.rs +++ b/wgpu/src/util/belt.rs @@ -140,7 +140,10 @@ impl StagingBelt { .buffer .slice(..) .map_async(MapMode::Write) - .inspect(move |_| sender.send(chunk).unwrap()) + .inspect(move |_| { + // The only possible error is the other side disconnecting, which is fine + let _ = sender.send(chunk); + }) })) .map(|_| ()) }