This commit is contained in:
Zack Radisic
2024-12-16 19:40:53 -08:00
committed by GitHub
parent f276484f25
commit 3906d02e2c
21 changed files with 324 additions and 78 deletions

View File

@@ -186,8 +186,14 @@ pub const VendorPrefix = packed struct(u8) {
}
/// Returns VendorPrefix::None if empty.
pub fn orNone(this: VendorPrefix) VendorPrefix {
return this.bitwiseOr(VendorPrefix{ .none = true });
pub inline fn orNone(this: VendorPrefix) VendorPrefix {
return this._or(VendorPrefix{ .none = true });
}
/// **WARNING**: NOT THE SAME as .bitwiseOr!!
pub inline fn _or(this: VendorPrefix, other: VendorPrefix) VendorPrefix {
if (this.isEmpty()) return other;
return this;
}
};