tiny-interner

Crates.iotiny-interner
lib.rstiny-interner
version0.1.5
sourcesrc
created_at2023-04-22 20:03:45.190773
updated_at2023-04-22 20:18:19.614008
descriptionEasy to use string interner with fast access to underlying strings and minimal memory footprint.
homepage
repositoryhttps://github.com/abs0luty/tiny-interner
max_upload_size
id846138
size12,160
Adi Salimgereev (abs0luty)

documentation

https://docs.rs/tiny-interner

README

🪐 tiny_interner crate.

~300 lines of Rust code that implement string internering for your programming language compiler.

Example

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");
}
Commit count: 16

cargo fmt