mirror of
https://github.com/OMGeeky/confique.git
synced 2026-01-21 02:42:02 +01:00
Revert "Replace some manual parsing code with darling helper crate"
This reverts commit e5af4f8efe.
The `darling` crate limits us to `syn::Meta` which is probably not
enough in the long run. There are a couple of other problems I have
with this crate and I think it's currently not worth. I'm considering
writing my own alternative...
This commit is contained in:
@@ -3,19 +3,14 @@ use proc_macro::TokenStream as TokenStream1;
|
||||
|
||||
mod gen;
|
||||
mod ir;
|
||||
mod parse;
|
||||
mod util;
|
||||
|
||||
|
||||
#[proc_macro_derive(Config, attributes(config))]
|
||||
pub fn config(input: TokenStream1) -> TokenStream1 {
|
||||
let input = match syn::parse2::<syn::DeriveInput>(input.into()) {
|
||||
Err(e) => return e.to_compile_error().into(),
|
||||
Ok(i) => i,
|
||||
};
|
||||
|
||||
ir::Input::from_ast(input)
|
||||
syn::parse2::<syn::DeriveInput>(input.into())
|
||||
.and_then(ir::Input::from_ast)
|
||||
.map(gen::gen)
|
||||
.unwrap_or_else(|e| e.write_errors())
|
||||
.unwrap_or_else(|e| e.to_compile_error())
|
||||
.into()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user