(input: proc_macro::TokenStream)
| 46 | |
| 47 | #[proc_macro] |
| 48 | pub fn construct_fixed_hashes(input: proc_macro::TokenStream) -> proc_macro::TokenStream { |
| 49 | let inputs = parse_macro_input!(input as definition::Definitions); |
| 50 | let expanded = { |
| 51 | inputs |
| 52 | .inner |
| 53 | .into_iter() |
| 54 | .map(|input| { |
| 55 | let parsed: fixed_hash::parsed::HashDefinition = input.into(); |
| 56 | fixed_hash::core::HashConstructor::new(parsed) |
| 57 | }) |
| 58 | .fold((quote!(), Vec::new()), |(hashes, mut ucs), uc| { |
| 59 | let (hash, public) = uc.construct_all(&ucs[..]); |
| 60 | let hashes = quote!(#hashes #public #hash); |
| 61 | ucs.push(uc); |
| 62 | (hashes, ucs) |
| 63 | }) |
| 64 | .0 |
| 65 | }; |
| 66 | expanded.into() |
| 67 | } |
nothing calls this directly
no test coverage detected