Crates.io | ry-interner |
lib.rs | ry-interner |
version | 0.1.1 |
source | src |
created_at | 2023-04-02 16:16:26.007078 |
updated_at | 2023-04-03 17:49:21.102846 |
description | Easy to use string interner with fast access to underlying strings and minimal memory footprint. |
homepage | |
repository | https://github.com/abs0luty/ry-interner |
max_upload_size | |
id | 828212 |
size | 12,159 |
ry_interner
crate.Extracted 327 lines of Rust code that implement string internering for Ry programming language compiler.
fn main() {
let interner = Interner::default();
let s1 = interner.get_or_intern("test");
let s2 = interner.get_or_intern("test");
assert_eq!(s1, s2);
assert_eq!(interner.resolve(0).unwrap(), "test");
}