MCPcopy Create free account
hub / github.com/cryptape/rust-numext / construct_fixed_hashes

Function construct_fixed_hashes

constructor/src/lib.rs:48–67  ·  view source on GitHub ↗
(input: proc_macro::TokenStream)

Source from the content-addressed store, hash-verified

46
47#[proc_macro]
48pub 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}

Callers

nothing calls this directly

Calls 1

construct_allMethod · 0.45

Tested by

no test coverage detected