{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreicaadsmbt4wzevpfqul2nqb76cvrfibrbgy5zgdnhs3b7kcowthme",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3miy7kyvzprn2"
},
"path": "/t/alloc-only-hashmap/24071#post_7",
"publishedAt": "2026-04-06T23:23:29.000Z",
"site": "https://internals.rust-lang.org",
"tags": [
"hashbrown",
"BTreeMap",
"BTreeSet"
],
"textContent": "A few alternatives:\n\nHave you considered using the hashbrown crate? It is the crate std uses for its hashmap/hashset implementation. This crate is no_std compatible.\n\nIf you don't want to add a new dependency, then you could use BTreeMap and BTreeSet, which do live in the `alloc` crate.\n\nIf you do need HashMap specifically, then you are a bit out of luck.",
"title": "`alloc`-only `HashMap`?"
}