mirror of
https://github.com/bytedream/serde-inline-default.git
synced 2026-11-04 15:12:09 +01:00
Initial commit
This commit is contained in:
commit
c46afd5ff6
10 files changed
+435
No files matched your search
+14
@@ -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