-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Add RefCell::take
#71398
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add RefCell::take
#71398
Conversation
85ad89d
to
0fb7907
Compare
I don't think we should have the |
0fb7907
to
1cc028f
Compare
I removed the inline attributes :) |
☔ The latest upstream changes (presumably #71439) made this pull request unmergeable. Please resolve the merge conflicts. |
In the same vein as `Cell::take` and `Option::take`.
1cc028f
to
4ea83bf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your PR and please excuse my late response. Looks like a useful addition! Just one inline comment.
As this is a tiny feature, I think the doc example is sufficient as test. The PR adding Cell::take
(#39287) also didn't add any tests.
No worries, thanks for the review! I copied the docs from |
@bors r+ |
📌 Commit 4a79424 has been approved by |
…asKalbertodt Add `RefCell::take` Add `RefCell::take` to match `Cell` and `Option`. I also changed a couple of calls to `.replace` to `.take`. Tracking issue is rust-lang#71395. This is my first contribution, please tell me if there's anything I could improve, thanks!
⌛ Testing commit 4a79424 with merge bba798dd3eaf4c68b9f1ef3cb223dbacf9f764c1... |
…asKalbertodt Add `RefCell::take` Add `RefCell::take` to match `Cell` and `Option`. I also changed a couple of calls to `.replace` to `.take`. Tracking issue is rust-lang#71395. This is my first contribution, please tell me if there's anything I could improve, thanks!
included in rollup, yielding @bors retry |
Rollup of 4 pull requests Successful merges: - rust-lang#71398 (Add `RefCell::take`) - rust-lang#71663 (Fix exceeding bitshifts not emitting for assoc. consts (properly this time, I swear!)) - rust-lang#71726 (Suggest deref when coercing `ty::Ref` to `ty::RawPtr` with arbitrary mutability) - rust-lang#71808 (Add long error explanation for E0539) Failed merges: r? @ghost
☔ The latest upstream changes (presumably #71853) made this pull request unmergeable. Please resolve the merge conflicts. |
Add
RefCell::take
to matchCell
andOption
.I also changed a couple of calls to
.replace
to.take
.Tracking issue is #71395.
This is my first contribution, please tell me if there's anything I could improve, thanks!