mirror of
https://github.com/bytedream/serde-inline-default.git
synced 2025-06-27 10:30:31 +02:00
Initial commit
This commit is contained in:
14
src/lib.rs
Normal file
14
src/lib.rs
Normal file
@ -0,0 +1,14 @@
|
||||
use proc_macro::TokenStream;
|
||||
use syn::{parse_macro_input, Item};
|
||||
|
||||
mod expand;
|
||||
|
||||
#[proc_macro_attribute]
|
||||
pub fn serde_inline_default(_attr: TokenStream, input: TokenStream) -> TokenStream {
|
||||
let item = parse_macro_input!(input as Item);
|
||||
|
||||
match item {
|
||||
Item::Struct(s) => expand::expand_struct(s),
|
||||
_ => panic!("can only be used on structs"),
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user