{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/21234","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/21234/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/21234/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/21234/events","html_url":"https://github.com/rust-lang/rust/issues/21234","id":54573701,"number":21234,"title":"HashSet should have a get function","user":{"login":"Noctune","id":448023,"avatar_url":"https://avatars.githubusercontent.com/u/448023?v=3","gravatar_id":"","url":"https://api.github.com/users/Noctune","html_url":"https://github.com/Noctune","followers_url":"https://api.github.com/users/Noctune/followers","following_url":"https://api.github.com/users/Noctune/following{/other_user}","gists_url":"https://api.github.com/users/Noctune/gists{/gist_id}","starred_url":"https://api.github.com/users/Noctune/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Noctune/subscriptions","organizations_url":"https://api.github.com/users/Noctune/orgs","repos_url":"https://api.github.com/users/Noctune/repos","events_url":"https://api.github.com/users/Noctune/events{/privacy}","received_events_url":"https://api.github.com/users/Noctune/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rust-lang/rust/labels/A-collections","name":"A-collections","color":"d7e102"},{"url":"https://api.github.com/repos/rust-lang/rust/labels/A-libs","name":"A-libs","color":"d7e102"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-01-16T13:10:09Z","updated_at":"2015-01-21T20:39:29Z","closed_at":"2015-01-21T20:39:29Z","body":"I think `HashSet` should have a `get` function like `HashMap` has, as equality does not necessarily mean that two elements are identical.\r\n\r\nThe reason I think this is necessary is that I'm trying to create a voxel world (think Minecraft) that is split into 3D chunks. Many of these chunks are identical (a lot of it is just air, for example), so it would make sense to reuse the a chunk in several places. When a new chunk is generated, the hash of the chunk is looked up in a collection to see if there is an already identical chunk and if there is, then use that one.\r\n\r\nIf `HashSet` had a `get` function then I could use a `HashSet<Arc<Chunk>>`, but since it does not, I instead have to use a `HashMap<Arc<Chunk>, Arc<Chunk>>` where the key and value is always the same which does not seem totally logical and downright impossible if it were a non-cloneable key.\r\n\r\nLikewise, it may be an idea to implement some sort of `get_key_value` that would return a key value pair for `HashMap`."},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/70916917","html_url":"https://github.com/rust-lang/rust/issues/21234#issuecomment-70916917","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/21234","id":70916917,"user":{"login":"steveklabnik","id":27786,"avatar_url":"https://avatars.githubusercontent.com/u/27786?v=3","gravatar_id":"","url":"https://api.github.com/users/steveklabnik","html_url":"https://github.com/steveklabnik","followers_url":"https://api.github.com/users/steveklabnik/followers","following_url":"https://api.github.com/users/steveklabnik/following{/other_user}","gists_url":"https://api.github.com/users/steveklabnik/gists{/gist_id}","starred_url":"https://api.github.com/users/steveklabnik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steveklabnik/subscriptions","organizations_url":"https://api.github.com/users/steveklabnik/orgs","repos_url":"https://api.github.com/users/steveklabnik/repos","events_url":"https://api.github.com/users/steveklabnik/events{/privacy}","received_events_url":"https://api.github.com/users/steveklabnik/received_events","type":"User","site_admin":false},"created_at":"2015-01-21T20:39:29Z","updated_at":"2015-01-21T20:39:29Z","body":"I'm pulling a massive triage effort to get us ready for 1.0. As part of this, I'm moving stuff that's wishlist-like to the RFCs repo, as that's where major new things should get discussed/prioritized.\n\nThis issue has been moved to the RFCs repo: rust-lang/rfcs#691"}}