I truly want proc macros this time
Some checks failed
/ Test-Suite (push) Failing after 19s

This commit is contained in:
Rowan Torbitzky-Lane 2025-04-16 21:57:33 -05:00
parent c8fe24dd45
commit c66d35b980
2 changed files with 23 additions and 0 deletions

9
rush_macro/Cargo.toml Normal file
View File

@ -0,0 +1,9 @@
[package]
name = "rush_macro"
version = "0.1.0"
edition = "2024"
[dependencies]
syn = { version = "2.0.100" }
quote = { version = "1.0.40" }
proc_macro2 = { version = "1.0.95" }

14
rush_macro/src/lib.rs Normal file
View File

@ -0,0 +1,14 @@
pub fn add(left: u64, right: u64) -> u64 {
left + right
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn it_works() {
let result = add(2, 2);
assert_eq!(result, 4);
}
}