This commit is contained in:
e2hang
2025-10-05 23:51:24 +08:00
parent 1f9543c16c
commit 23f17bfc2c
113 changed files with 1236 additions and 0 deletions

10
Macro/macrotest.rs Normal file
View File

@@ -0,0 +1,10 @@
macro_rules! double_and_add_one {
($x : expr) => {
$x * 2 + 1;
};
}
fn main(){
let result = double_and_add_one!(5);
println!("Result: {}", result); // This will print "Result: 11"
}