Update lib.rs

pull/890/head
qwer252 1 month ago committed by GitHub
parent f9c9174fc6
commit e65bdb9c2d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -3,10 +3,9 @@ use quote::quote;
#[proc_macro_derive(HelloMacro)] #[proc_macro_derive(HelloMacro)]
pub fn hello_macro_derive(input: TokenStream) -> TokenStream { pub fn hello_macro_derive(input: TokenStream) -> TokenStream {
// Construct a representation of Rust code as a syntax tree // 将 Rust 代码构建成我们可以操作的语法树。
// that we can manipulate.
let ast = syn::parse(input).unwrap(); let ast = syn::parse(input).unwrap();
// Build the trait implementation. // 生成 trait 的实现。
impl_hello_macro(&ast) impl_hello_macro(&ast)
} }

Loading…
Cancel
Save