Skip to content

Commit

Permalink
Convert vk_bitflags_wrapped! methods to const fn (#549)
Browse files Browse the repository at this point in the history
  • Loading branch information
thorjelly authored Jan 11, 2022
1 parent 03068a8 commit 98192d1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ash/src/vk/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 98192d1

Please sign in to comment.