feat: FromPyFromStr and ToStrToPy macros YAY
This commit is contained in:
@@ -1,17 +1,5 @@
|
||||
use proc_macro2::TokenStream;
|
||||
use quote::quote;
|
||||
use syn::{DeriveInput, parse_macro_input};
|
||||
mod from_py_from_str;
|
||||
mod to_str_to_py;
|
||||
|
||||
pub fn py_from_str(input: TokenStream) -> TokenStream {
|
||||
let derive_input: DeriveInput = parse_macro_input!(input);
|
||||
|
||||
let (impl_generics, ty_generics, where_clause) = generics.split_for_impl();
|
||||
|
||||
let expanded = quote! {
|
||||
impl #impl_generics MyTrait for #name #ty_generics #where_clause {
|
||||
// ...
|
||||
}
|
||||
};
|
||||
|
||||
expanded
|
||||
}
|
||||
pub use from_py_from_str::FromPyFromStr;
|
||||
pub use to_str_to_py::ToStrToPy;
|
||||
|
||||
Reference in New Issue
Block a user