Skip to content

Commit 9f529e8

Browse files
committed
Add |= operator for bitfields
1 parent 3acd12b commit 9f529e8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

godot-codegen/src/generator/enums.rs

+7
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,13 @@ fn make_enum_bitwise_operators(enum_: &Enum) -> TokenStream {
372372
Self { ord: self.ord | rhs.ord }
373373
}
374374
}
375+
376+
impl std::ops::BitOrAssign for #name {
377+
#[inline]
378+
fn bitor_assign(&mut self, rhs: Self) {
379+
*self = *self | rhs;
380+
}
381+
}
375382
}
376383
} else if let Some(mask_enum) = special_cases::as_enum_bitmaskable(enum_) {
377384
// Enum that has an accompanying bitfield for masking.

0 commit comments

Comments
 (0)