23 lines
610 B
Rust
23 lines
610 B
Rust
use quote::{ToTokens, quote};
|
|
use syn::{parse::Parse, spanned::Spanned};
|
|
|
|
pub struct RefAndMut {
|
|
name: syn::Ident,
|
|
}
|
|
|
|
impl Parse for RefAndMut {
|
|
fn parse(input: syn::parse::ParseStream) -> syn::Result<Self> {
|
|
// let type_path = input.parse::<syn::TypePath>()?;
|
|
// let matching = input.parse::<syn::PatStruct>()?;
|
|
let name = input.parse::<syn::Ident>()?;
|
|
// panic!("{type_path:?}\n\n{matching:?}");
|
|
Ok(Self { name })
|
|
}
|
|
}
|
|
|
|
impl ToTokens for RefAndMut {
|
|
fn to_tokens(&self, tokens: &mut proc_macro2::TokenStream) {
|
|
tokens.extend(quote! {});
|
|
}
|
|
}
|