Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #268 from konsumlamm/fix-debug
Fix bug in `Debug` implementation
- Loading branch information
Showing
5 changed files
with
24 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,4 +62,4 @@ impl BitFlags for BootlegFlags { | |
} | ||
} | ||
|
||
fn main() { } | ||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,4 @@ impl From<u32> for Flags { | |
} | ||
} | ||
|
||
fn main() { | ||
|
||
} | ||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use bitflags::bitflags; | ||
|
||
bitflags! { | ||
struct Flags: u8 { | ||
const TWO = 0x2; | ||
} | ||
} | ||
|
||
fn main() { | ||
// bug #267 (https://github.com/bitflags/bitflags/issues/267) | ||
let flags = unsafe { Flags::from_bits_unchecked(0b11) }; | ||
assert_eq!(format!("{:?}", flags), "TWO | 0x1"); | ||
assert_eq!(format!("{:#?}", flags), "TWO | 0x1"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters