Apply suggestion of clippy if_not_else lint

This commit is contained in:
Mika Attila 2016-03-03 19:48:44 +01:00
parent 41aa413a7c
commit 8ee77fd5f4

View File

@ -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
}
}