2023-11-30 13:10:05 -06:00
|
|
|
# Templest
|
|
|
|
A single procedural macro to make temporary variables easier.
|
|
|
|
Code example:
|
|
|
|
```rs
|
2023-12-01 14:57:18 -06:00
|
|
|
use templest::temp;
|
2023-11-30 13:10:05 -06:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let temp!() = 10;
|
|
|
|
|
|
|
|
println!("{:?}", temp!(-));
|
|
|
|
}
|
|
|
|
```
|
|
|
|
This code example prints `10` to the console.
|
|
|
|
If we add a new temporary variable, after we define the first one as 10, and define that as 20, than 20 will be printed.
|
|
|
|
```rs
|
2023-12-01 14:57:18 -06:00
|
|
|
use templest::temp;
|
2023-11-30 13:10:05 -06:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let temp!() = 10;
|
|
|
|
let temp!() = 20;
|
|
|
|
|
|
|
|
println!("{:?}", temp!(-));
|
|
|
|
}
|
|
|
|
```
|
|
|
|
This new code example will print `20` to the console.
|