Merge pull request #342 from MarijnS95/patch-1

This commit is contained in:
Amanieu d'Antras 2022-05-29 09:33:22 +02:00 committed by GitHub
commit 6f6e021ced
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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>