Skip to content

Commit

Permalink
lock_api/rwlock: Appropriately mention try_map instead of map in …
Browse files Browse the repository at this point in the history
…`try_map` docs
  • Loading branch information
MarijnS95 committed May 28, 2022
1 parent d979c8c commit d64f3a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lock_api/src/rwlock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1218,13 +1218,13 @@ impl<'a, R: RawRwLock + 'a, T: ?Sized + 'a> RwLockReadGuard<'a, R, T> {
}

/// Attempts to make a new `MappedRwLockReadGuard` for a component of the
/// locked data. The original guard is return if the closure returns `None`.
/// locked data. Returns the original guard if the closure returns `None`.
///
/// This operation cannot fail as the `RwLockReadGuard` passed
/// in already locked the data.
///
/// This is an associated function that needs to be
/// used as `RwLockReadGuard::map(...)`. A method would interfere with methods of
/// used as `RwLockReadGuard::try_map(...)`. A method would interfere with methods of
/// the same name on the contents of the locked data.
#[inline]
pub fn try_map<U: ?Sized, F>(s: Self, f: F) -> Result<MappedRwLockReadGuard<'a, R, U>, Self>
Expand Down

0 comments on commit d64f3a5

Please sign in to comment.