Skip to content

Commit

Permalink
Fix GcCellRef::map doctest
Browse files Browse the repository at this point in the history
Signed-off-by: Anders Kaseorg <[email protected]>
  • Loading branch information
andersk committed Jul 17, 2024
1 parent d84eb95 commit 8a5cfdd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ impl<'a, T: ?Sized> GcCellRef<'a, T> {
}
}

/// Makes a new `GcCellRef` from a component of the borrowed data.
/// Makes a new `GcCellRef` for a component of the borrowed data.
///
/// The `GcCell` is already immutably borrowed, so this cannot fail.
///
Expand All @@ -763,7 +763,7 @@ impl<'a, T: ?Sized> GcCellRef<'a, T> {
/// let c = GcCell::new((5, 'b'));
/// let b1: GcCellRef<(u32, char)> = c.borrow();
/// let b2: GcCellRef<u32> = GcCellRef::map(b1, |t| &t.0);
/// //assert_eq!(b2, 5);
/// assert_eq!(*b2, 5);
/// ```
#[inline]
pub fn map<U, F>(orig: Self, f: F) -> GcCellRef<'a, U>
Expand Down

0 comments on commit 8a5cfdd

Please sign in to comment.