mshc-macro-shared 0.1.13

Shared macro source for 'mshc' and 'mshc-derive'
Documentation
1
2
3
4
5
6
7
8
9
10
11
/// Get (named) struct fields.
pub fn get_struct_fields(input: &syn::DeriveInput) -> &syn::FieldsNamed {
    match &input.data {
        syn::Data::Struct(data) => match &data.fields {
            syn::Fields::Named(fields) => fields,
            _ => unimplemented!("Only named fields supported.")
        },

        _ => unimplemented!("Only structs supported.")
    }
}