Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #[macro_use] extern crate bitflags;
- bitflags! {
- /// This can be a combination of `BOLD`, `UNDERLINE` and `ITALIC`
- pub struct FontStyle: u32 {
- /// Bold font style
- const BOLD = 1;
- /// Underline font style
- const UNDERLINE = 2;
- /// Italic font style
- const ITALIC = 4;
- }
- }
- fn main() {
- let style: FontStyle = FontStyle::BOLD | FontStyle::ITALIC;
- let style_u32: u32 = style.bits();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement