Crates.io | interning |
lib.rs | interning |
version | 0.2.3 |
source | src |
created_at | 2024-02-04 12:29:04.234752 |
updated_at | 2024-02-05 12:40:27.157371 |
description | A Simple Thread-Lcoal and Global Interning Library |
homepage | |
repository | https://github.com/JakkuSakura/interning |
max_upload_size | |
id | 1126331 |
size | 15,362 |
Interning is the process of storing only one copy of each distinct string value, which must be immutable. This process is used to save memory space and improve performance.
Add dependencies to your Cargo.toml
:
[dependencies]
interning = "0.2"
use interning::InternedString;
fn main() {
let s1 = InternedString::new("hello");
let s2 = InternedString::new("hello");
assert_eq!(s1, s2);
}