Skip to content
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

Fix comments #180

Merged
merged 2 commits into from May 30, 2022
Merged

Fix comments #180

merged 2 commits into from May 30, 2022

Conversation

muramasa8191
Copy link
Contributor

Fix comments

The example of get_mut looks like that for new.
Actually, the comment before the example finishes with ':'. So, it looks like in the middle of sentence or incomplete.

///
/// let mut cell: OnceCell<u32> = OnceCell::new();
/// cell.set(92).unwrap();
/// cell = OnceCell::new();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the example is where it needs to be, but is incomplete. Let's change it to

use once_cell::unsync::OnceCell;

let mut cell: OnceCell<u32> = OnceCell::new();
cell.set(92).unwrap();
*cell.get_mut().unwrap() = 93;
assert_eq!(cell.get(), Some(&93));

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. I fixed like that in a361.

@matklad
Copy link
Owner

matklad commented May 30, 2022

bors r+

Thanks!

@bors
Copy link
Contributor

bors bot commented May 30, 2022

Build succeeded:

@bors bors bot merged commit 485aaa8 into matklad:master May 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants