I need to refer to a value after inserting it into set. However after inserting the container becomes the owner of the element and I can no longer refer to it. Is this achievable without updating the containers API?
Ideally I'm looking for some function with the following signature:
fn insert_referring<A>(set: &mut HashSet<A>, element: A) -> &A