try_replace, try_swap in RefCell (code included) #54493
Labels
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
Every method has a non-panicking variant except for
replace
andswap
. It would be fairly simple to add them, leveraging thetry_borrow_mut
method; here's the code:I currently don't have the ability to clone the repo, test, etc. right now. I'm also bad at making examples, so those need to be added. 😏
So I've made this issue. If / when I have time, I will probably try to make a PR for this myself, if no one's done it yet. However, that might be months...
The text was updated successfully, but these errors were encountered: