{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreiabx5ibtszt4xehhsknj4pb5qjj3sqvufnyzaijvx4zurp2qbqbei",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mljqemvekoj2"
},
"path": "/t/interiorassign-trait-a-b/24291#post_14",
"publishedAt": "2026-05-10T20:02:17.000Z",
"site": "https://internals.rust-lang.org",
"textContent": "bluelightzero:\n\n> For completeness, the current way to do this would be:\n>\n>\n> num = Some(13)\n>\n\nAnd another way to do this currently is\n\n\n num = 13.into();\n\n\n* * *\n\nBy the way, a current way to “assign” (rather than “replace”, i.e. not getting back the previous value as an output) inside of a `RefCell`, that actually uses the assignment operator, would be\n\n\n *data.ref_cell.borrow_mut() = Some(new_value);\n\n\ninstead of the\n\n\n data.ref_cell.replace(Some(new_value));\n\n\nmentioned in the original post of this thread.\n\nGiven `mem::replace` is `must_use` already, this makes me wonder if `RefCell::replace` should be `must_use`, too.",
"title": "InteriorAssign trait { a := b }"
}