rustfmt_config_proc_macro/
config_type.rs

1use proc_macro2::TokenStream;
2
3use crate::item_enum::define_config_type_on_enum;
4use crate::item_struct::define_config_type_on_struct;
5
6/// Defines `config_type` on enum or struct.
7// FIXME: Implement this on struct.
8pub fn define_config_type(input: &syn::Item) -> TokenStream {
9    match input {
10        syn::Item::Struct(st) => define_config_type_on_struct(st),
11        syn::Item::Enum(en) => define_config_type_on_enum(en),
12        _ => panic!("Expected enum or struct"),
13    }
14    .unwrap()
15}