| Crates.io | uniqify |
| lib.rs | uniqify |
| version | 0.1.0 |
| created_at | 2025-09-24 23:10:28.116695+00 |
| updated_at | 2025-09-24 23:10:28.116695+00 |
| description | Compile-time unique IDs for Rust, a `__COUNTER__`-like macro, safe and simple |
| homepage | |
| repository | https://git.gay/vi/uniqify |
| max_upload_size | |
| id | 1853911 |
| size | 7,319 |
A Rust equivalent of the C macro __COUNTER__, generating unique integers at compile time.
cargo add uniqify
use uniqify::uniqify;
fn main() {
let a = uniqify!();
let b = uniqify!();
let c = uniqify!();
println!("{a}, {b}, {c}");
}
0, 1, 2
If there are any issues, I will try to resolve them, but I must admit that I am not very good with macros and that, for me, it is still a bit of a miracle.