Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #[macro_use] extern crate bitflags;
  2.  
  3. bitflags! {
  4. /// This can be a combination of `BOLD`, `UNDERLINE` and `ITALIC`
  5. pub struct FontStyle: u32 {
  6. /// Bold font style
  7. const BOLD = 1;
  8. /// Underline font style
  9. const UNDERLINE = 2;
  10. /// Italic font style
  11. const ITALIC = 4;
  12. }
  13. }
  14.  
  15.  
  16. fn main() {
  17. let style: FontStyle = FontStyle::BOLD | FontStyle::ITALIC;
  18. let style_u32: u32 = style.bits();
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement