Skip to content

Fix comments#180

Merged
bors[bot] merged 2 commits intomatklad:masterfrom
muramasa8191:fix_fet_mut_comment
May 30, 2022
Merged

Fix comments#180
bors[bot] merged 2 commits intomatklad:masterfrom
muramasa8191:fix_fet_mut_comment

Conversation

@muramasa8191
Copy link
Copy Markdown
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.

Comment thread src/lib.rs
///
/// let mut cell: OnceCell<u32> = OnceCell::new();
/// cell.set(92).unwrap();
/// cell = OnceCell::new();
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Owner

matklad commented May 30, 2022

bors r+

Thanks!

@bors
Copy link
Copy Markdown
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.

2 participants