-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Add missing examples for std::cell types #34736
Conversation
/// let c2 = c.get_mut(); | ||
/// *c2 += 1; | ||
/// } | ||
/// assert_eq!(c, Cell::new(6)); |
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.
Can this just be
assert_eq!(c.get(), 6);
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.
Sure!
3ce6191
to
2c964e0
Compare
/// use std::cell::Cell; | ||
/// | ||
/// let mut c = Cell::new(5); | ||
/// { |
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.
Can this block just be replaced with
*c.get_mut() += 1;
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.
Sure!
2c964e0
to
76dd020
Compare
Updated. |
@bors: r+ rollup |
📌 Commit 76dd020 has been approved by |
…abnik Add missing examples for std::cell types Fixes rust-lang#29344. r? @steveklabnik
Fixes #29344.
r? @steveklabnik