pub const DefaultingBool = enum(u2) pub fn init(b: ?bool) DefaultingBoolpub fn toBool(db: DefaultingBool) ?bool1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009pub const DefaultingBool = enum(u2) {
false,
true,
default,
pub fn init(b: ?bool) DefaultingBool {
return switch (b orelse return .default) {
false => .false,
true => .true,
};
}
pub fn toBool(db: DefaultingBool) ?bool {
return switch (db) {
.false => false,
.true => true,
.default => null,
};
}
}