From 8a2410be326c8d9fe3a3c0256750f2bc8b57ce7d Mon Sep 17 00:00:00 2001 From: Ivan Kalinin Date: Sat, 12 Oct 2024 14:45:35 +0200 Subject: [PATCH] fix: fix an obviously incorrect level mask check --- src/cell/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cell/mod.rs b/src/cell/mod.rs index 3f1a1ab7..eecf5aa7 100644 --- a/src/cell/mod.rs +++ b/src/cell/mod.rs @@ -1153,7 +1153,7 @@ impl LevelMask { /// Returns whether the specified level is included into the mask. pub const fn contains(self, level: u8) -> bool { - level == 0 || self.0 & LevelMask::from_level(level).0 != 0 + level == 0 || self.0 & (1 << (level - 1)) != 0 } /// Creates a new mask, shifted by the offset.