inline OptVariable functions

This commit is contained in:
Folkert 2022-05-20 22:53:56 +02:00
parent e9bdf0e5de
commit ac30ec5489
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C

View file

@ -860,14 +860,17 @@ pub struct OptVariable(u32);
impl OptVariable {
pub const NONE: OptVariable = OptVariable(Variable::NULL.0);
#[inline(always)]
pub const fn is_none(self) -> bool {
self.0 == Self::NONE.0
}
#[inline(always)]
pub const fn is_some(self) -> bool {
self.0 != Self::NONE.0
}
#[inline(always)]
pub const fn into_variable(self) -> Option<Variable> {
if self.is_none() {
None