mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 15:51:12 +00:00
inline OptVariable functions
This commit is contained in:
parent
e9bdf0e5de
commit
ac30ec5489
1 changed files with 3 additions and 0 deletions
|
@ -860,14 +860,17 @@ pub struct OptVariable(u32);
|
||||||
impl OptVariable {
|
impl OptVariable {
|
||||||
pub const NONE: OptVariable = OptVariable(Variable::NULL.0);
|
pub const NONE: OptVariable = OptVariable(Variable::NULL.0);
|
||||||
|
|
||||||
|
#[inline(always)]
|
||||||
pub const fn is_none(self) -> bool {
|
pub const fn is_none(self) -> bool {
|
||||||
self.0 == Self::NONE.0
|
self.0 == Self::NONE.0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline(always)]
|
||||||
pub const fn is_some(self) -> bool {
|
pub const fn is_some(self) -> bool {
|
||||||
self.0 != Self::NONE.0
|
self.0 != Self::NONE.0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline(always)]
|
||||||
pub const fn into_variable(self) -> Option<Variable> {
|
pub const fn into_variable(self) -> Option<Variable> {
|
||||||
if self.is_none() {
|
if self.is_none() {
|
||||||
None
|
None
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue