From d06550aa74aec03155c073a4ca3355a0b8fef472 Mon Sep 17 00:00:00 2001 From: Artemis Everfree Date: Wed, 1 Jan 2025 15:23:03 -0800 Subject: [PATCH] Add to_u16() accessor to TextEntry --- src/video/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/video/mod.rs b/src/video/mod.rs index 8738c23..3c659f2 100644 --- a/src/video/mod.rs +++ b/src/video/mod.rs @@ -323,6 +323,13 @@ impl TextEntry { pub const fn from_tile(id: u16) -> Self { Self(id & 0b11_1111_1111) } + + /// Unwrap this value into its raw `u16` form. + #[inline] + #[must_use] + pub const fn to_u16(self) -> u16 { + self.0 + } } #[inline]