From 8a5cfddec71a1b88dbb0dc9a377ab9db4eb501c9 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Wed, 17 Jul 2024 11:00:58 -0700 Subject: [PATCH] Fix GcCellRef::map doctest Signed-off-by: Anders Kaseorg --- gc/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gc/src/lib.rs b/gc/src/lib.rs index 17ef897..28f0e08 100644 --- a/gc/src/lib.rs +++ b/gc/src/lib.rs @@ -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. /// @@ -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 = GcCellRef::map(b1, |t| &t.0); - /// //assert_eq!(b2, 5); + /// assert_eq!(*b2, 5); /// ``` #[inline] pub fn map(orig: Self, f: F) -> GcCellRef<'a, U>