mirror of
https://gitee.com/openharmony/third_party_rust_bitflags
synced 2024-11-23 07:10:11 +00:00
Apply suggestion of clippy if_not_else lint
This commit is contained in:
parent
41aa413a7c
commit
8ee77fd5f4
@ -316,10 +316,10 @@ macro_rules! bitflags {
|
||||
/// representation contains bits that do not correspond to a flag.
|
||||
#[inline]
|
||||
pub fn from_bits(bits: $T) -> $crate::__core::option::Option<$BitFlags> {
|
||||
if (bits & !$BitFlags::all().bits()) != 0 {
|
||||
$crate::__core::option::Option::None
|
||||
} else {
|
||||
if (bits & !$BitFlags::all().bits()) == 0 {
|
||||
$crate::__core::option::Option::Some($BitFlags { bits: bits })
|
||||
} else {
|
||||
$crate::__core::option::Option::None
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user