I am trying to create a StringInterner for a bidirectional mapping between String and an indexable type,
such as can be found in the Rust compile for the symbol table implementation.
The goal is to create it with as low memory overhead as possibru.
This implementation works and satisfies its unit-tests. However, I am feeling dirty for this unidiomatic code.
In this solution the HashMap maps from InternalStrRef which is a tight wrapper around *const str instances.
I was even able to find a bug with my former implementation!
Can you elaborate further how hashes as external indices could work?