2 unstable releases
Uses new Rust 2024
| 0.2.0 | Aug 4, 2025 |
|---|---|
| 0.1.0 | Aug 4, 2025 |
#2530 in Rust patterns
19KB
528 lines
A simple library for interning strings.
Atoms are string singletons that live for the lifetime of the program. For any given string that is made into an Atom, there will only be one instance of that Atom allocated for the program. After an Atom is created, it can not be destroyed.
let atom_a = Atom::new("single instance");
let atom_b = Atom::new("single instance");
assert_eq!(Atom::ptr_eq(&atom_a, &atom_b));
Dependencies
~145KB