I want to store strings in an Arena and provide fast lookup to the id via a hashmap. Unfortunately, I seem to be encountering lifetime issues, which was the point of the arena in the first place.
I am using the id-arena crate.
I create an Arena and a HashMap<&'a String, Id>.
I first add a new string to the arena, which returns an Id.
I then try and look up the data from the arena using get, which returns Option<&String>.
When I unwrap and try and insert this into the hashmap, I get a familiar complaint:
cannot infer an appropriate lifetime for autoref due to conflicting requirements