Interesting macro

This commit is contained in:
franklinblanco 2022-08-13 17:09:32 -04:00
parent 20dd8f1dee
commit de30a033ec
2 changed files with 7 additions and 8 deletions

View File

@ -4,7 +4,6 @@ version = "0.1.0"
edition = "2021"
[lib]
proc-macro = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

View File

@ -1,10 +1,10 @@
use proc_macro::TokenStream;
use quote::{quote};
#[proc_macro]
pub fn nigga(_input: TokenStream) -> TokenStream {
TokenStream::from(quote!(
122
))
macro_rules! test_macro {
($out_struct:path, $path:literal) => ( {
println!($path);
});
}
fn _s() {
test_macro!(String, "a");
}