{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreidgvngugj3xciaubggrz27zulkg6tzlyxg67xajooobcx25x3uxfm",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mkby357ot2p2"
},
"path": "/t/could-collections-hypothetically-store-keys-and-values-inline/24195#post_9",
"publishedAt": "2026-04-25T01:04:05.000Z",
"site": "https://internals.rust-lang.org",
"tags": [
"compact_str"
],
"textContent": "Vorpal:\n\n> Why would you want to make that guarantee? I could absolutely see the case for HashMap using specialisation in the future to store small keys and values inline.\n\n`String` would also benefit from small string optimization, see for example compact_str. The stdlib precluded this optimization however.",
"title": "Could collections hypothetically store keys and values inline?"
}