Skip to content

Commit 485aaa8

Browse files
Merge #180
180: Fix comments r=matklad a=muramasa8191 # 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. Co-authored-by: Masa Tamura <[email protected]>
2 parents 9879c77 + a36132d commit 485aaa8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,8 @@ pub mod unsync {
464464
///
465465
/// let mut cell: OnceCell<u32> = OnceCell::new();
466466
/// cell.set(92).unwrap();
467-
/// cell = OnceCell::new();
467+
/// *cell.get_mut().unwrap() = 93;
468+
/// assert_eq!(cell.get(), Some(&93));
468469
/// ```
469470
pub fn get_mut(&mut self) -> Option<&mut T> {
470471
// Safe because we have unique access

0 commit comments

Comments
 (0)