From 42e16c7e7de077f8df8827a1cbf262c45565afef Mon Sep 17 00:00:00 2001 From: teoxoy <28601907+teoxoy@users.noreply.github.com> Date: Thu, 27 Jun 2024 19:31:17 +0200 Subject: [PATCH] simplify logic of `Entry.is_valid` --- wgpu-core/src/command/bind.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/wgpu-core/src/command/bind.rs b/wgpu-core/src/command/bind.rs index b0c7817c04..e6390f9a82 100644 --- a/wgpu-core/src/command/bind.rs +++ b/wgpu-core/src/command/bind.rs @@ -40,17 +40,15 @@ mod compat { } fn is_valid(&self) -> bool { - if self.expected.is_none() { - return true; - } if let Some(expected_bgl) = self.expected.as_ref() { if let Some(assigned_bgl) = self.assigned.as_ref() { - if expected_bgl.is_equal(assigned_bgl) { - return true; - } + expected_bgl.is_equal(assigned_bgl) + } else { + false } + } else { + true } - false } fn is_incompatible(&self) -> bool {