{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreiezbv2vzykoq7qjnl5udnsshdk2eurktkhqu3vlam7mik52zixdue",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mloa6qr7bf62"
},
"path": "/t/interiorassign-trait-a-b/24291?page=2#post_30",
"publishedAt": "2026-05-12T15:46:40.000Z",
"site": "https://internals.rust-lang.org",
"textContent": "bluelightzero:\n\n> I think what I might do instead though is just create a macro or use scripting because all I really want to do is abstract away a pattern that is going to be repeated thousands of times.\n\nThe first tool you should be reaching for to fix repeated code is a _function_ , not a macro.\n\n\n fn set_opt<T>(cell: &RefCell<Option<T>>, value: T) {\n *cell.borrow_mut() = Some(value);\n }\n\n\nYou should also consider whether the problem can be solved with less use of `RefCell`.",
"title": "InteriorAssign trait { a := b }"
}