mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 12:51:06 +00:00
Bug 1828217 - Add from_bits_retain for increased compatibility. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D175710
This commit is contained in:
parent
6a16e9e717
commit
c996a2aa5b
@ -46,6 +46,15 @@ macro_rules! bitflags {
|
||||
}
|
||||
}
|
||||
|
||||
impl $BitFlags {
|
||||
/// Convert from underlying bit representation, preserving all
|
||||
/// bits (even those not corresponding to a defined flag).
|
||||
#[inline]
|
||||
pub const fn from_bits_retain(bits: $T) -> Self {
|
||||
Self { bits }
|
||||
}
|
||||
}
|
||||
|
||||
bitflags! {
|
||||
$($t)*
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user