summaryrefslogtreecommitdiff
path: root/src/arm32/flag
diff options
context:
space:
mode:
Diffstat (limited to 'src/arm32/flag')
-rw-r--r--src/arm32/flag/mod.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/arm32/flag/mod.rs b/src/arm32/flag/mod.rs
index b24e103..fe564e4 100644
--- a/src/arm32/flag/mod.rs
+++ b/src/arm32/flag/mod.rs
@@ -19,6 +19,11 @@
// fero General Public License along with Pollex.
// If not, see <https://www.gnu.org/licenses/>.
+// TODO: This type is usefule for easily being for-
+// matted, but is otherwise quite akwardly imple-
+// mented (see the constant generic). Could we re-
+// it?
+
use core::fmt::Display;
/// A flag.
@@ -30,10 +35,12 @@ pub enum Flag<const C: char> {
}
impl<const C: char> Flag<C> {
+ /// Checks if the flag is off.
#[inline(always)]
#[must_use]
pub const fn is_off(self) -> bool { self as u8 == Self::Off as u8 }
+ /// Checks if the flag is on.
#[inline(always)]
#[must_use]
pub const fn is_on(self) -> bool { self as u8 == Self::On as u8 }