From 98192d11f21b43acc3ffbfd56a16ced23347a2a7 Mon Sep 17 00:00:00 2001 From: thorjelly Date: Tue, 11 Jan 2022 08:49:53 -0800 Subject: [PATCH] Convert `vk_bitflags_wrapped!` methods to `const fn` (#549) --- ash/src/vk/macros.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ash/src/vk/macros.rs b/ash/src/vk/macros.rs index b0e9a1a..e87d143 100644 --- a/ash/src/vk/macros.rs +++ b/ash/src/vk/macros.rs @@ -20,17 +20,17 @@ macro_rules! vk_bitflags_wrapped { self.0 } #[inline] - pub fn is_empty(self) -> bool { - self == Self::empty() + pub const fn is_empty(self) -> bool { + self.0 == Self::empty().0 } #[inline] - pub fn intersects(self, other: Self) -> bool { - self & other != Self::empty() + pub const fn intersects(self, other: Self) -> bool { + !Self(self.0 & other.0).is_empty() } #[doc = r" Returns whether `other` is a subset of `self`"] #[inline] - pub fn contains(self, other: Self) -> bool { - self & other == other + pub const fn contains(self, other: Self) -> bool { + self.0 & other.0 == other.0 } } impl ::std::ops::BitOr for $name {