-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify what Cell::replace
returns
#80385
Conversation
r? @cramertj (rust-highfive has picked a reviewer for you, use r? to override) |
@@ -374,7 +374,7 @@ impl<T> Cell<T> { | |||
} | |||
} | |||
|
|||
/// Replaces the contained value, and returns it. | |||
/// Replaces the contained value with `val`, and returns the old contained value. |
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.
/// Replaces the contained value with `val`, and returns the old contained value. | |
/// Replaces the wrapped value with a new one, returning the old value, | |
/// without deinitializing either one. | |
/// | |
/// This function corresponds to [`std::mem::replace`](../mem/fn.replace.html). |
Why not just use the same one as RefCell::replace
?
I was waiting for a review from @cramertj, the assignee. |
@bors r+ rollup I think this is good. I'm not convinced that reference to mem::replace or the alternative wording is better. |
📌 Commit c71f523 has been approved by |
…r=Mark-Simulacrum Clarify what `Cell::replace` returns
…r=Mark-Simulacrum Clarify what `Cell::replace` returns
…r=Mark-Simulacrum Clarify what `Cell::replace` returns
Rollup of 11 pull requests Successful merges: - rust-lang#80385 (Clarify what `Cell::replace` returns) - rust-lang#82571 (Rustdoc Json: Add tests for Reexports, and improve jsondocck) - rust-lang#82860 (Add `-Z unpretty` flag for the THIR) - rust-lang#82950 (convert slice doc link to intra-doc links) - rust-lang#82965 (Add spirv extension handling in compiletest) - rust-lang#82966 (update MSYS2 link in README) - rust-lang#82979 (Fix "run" button position in error index) - rust-lang#83001 (Ignore Vim swap files) - rust-lang#83003 (rustdoc: tweak the search index format) - rust-lang#83013 (Adjust some `#[cfg]`s to take non-Unix non-Windows operating systems into account) - rust-lang#83018 (Reintroduce accidentally deleted assertions.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
No description provided.