(input: proc_macro::TokenStream)
| 24 | |
| 25 | #[proc_macro] |
| 26 | pub fn construct_fixed_uints(input: proc_macro::TokenStream) -> proc_macro::TokenStream { |
| 27 | let inputs = parse_macro_input!(input as definition::Definitions); |
| 28 | let expanded = { |
| 29 | inputs |
| 30 | .inner |
| 31 | .into_iter() |
| 32 | .map(|input| { |
| 33 | let parsed: fixed_uint::parsed::UintDefinition = input.into(); |
| 34 | fixed_uint::core::UintConstructor::new(parsed) |
| 35 | }) |
| 36 | .fold((quote!(), Vec::new()), |(uints, mut ucs), uc| { |
| 37 | let (uint, public) = uc.construct_all(&ucs[..]); |
| 38 | let uints = quote!(#uints #public #uint); |
| 39 | ucs.push(uc); |
| 40 | (uints, ucs) |
| 41 | }) |
| 42 | .0 |
| 43 | }; |
| 44 | expanded.into() |
| 45 | } |
| 46 | |
| 47 | #[proc_macro] |
| 48 | pub fn construct_fixed_hashes(input: proc_macro::TokenStream) -> proc_macro::TokenStream { |
nothing calls this directly
no test coverage detected