Last active
January 4, 2018 15:24
-
-
Save MaikKlein/f7fefe1dc6a99c334bd8c4384ef4651d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| impl #ident{ | |
| #[cfg(feature = "std")] // This is somehow lost :( | |
| pub fn from_bitflag(bitflag: ::enumflags::BitFlags<#ident>) -> Vec<#ident> { | |
| #flag_values_ref1.iter().filter_map(|val|{ | |
| let val = *val as #ty & bitflag.bits(); | |
| match val { | |
| #(#flag_value_names => Some(#names_ref :: #variants_ref),)* | |
| _ => None | |
| } | |
| }).collect() | |
| } | |
| ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment