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

Function construct_fixed_uints

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

Source from the content-addressed store, hash-verified

24
25#[proc_macro]
26pub 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]
48pub fn construct_fixed_hashes(input: proc_macro::TokenStream) -> proc_macro::TokenStream {

Callers

nothing calls this directly

Calls 1

construct_allMethod · 0.45

Tested by

no test coverage detected