Apply suggestions from code review

Co-authored-by: Amanieu d'Antras <amanieu@gmail.com>
This commit is contained in:
zachs18 2024-02-23 20:18:04 -06:00 committed by GitHub
parent 06ec7a7611
commit 8aaa04b5c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -612,7 +612,7 @@ pub fn map<U, F>(orig: Self, f: F) -> MappedMutexGuard<'a, U>
F: FnOnce(&mut T) -> &mut U,
U: ?Sized,
{
// SAFETY: the conditions of `MutedGuard::new` were satisfied when the original guard
// SAFETY: the conditions of `MutexGuard::new` were satisfied when the original guard
// was created, and have been upheld throughout `map` and/or `try_map`.
// The signature of the closure guarantees that it will not "leak" the lifetime of the reference
// passed to it. If the closure panics, the guard will be dropped.
@ -720,7 +720,7 @@ pub fn map<U, F>(mut orig: Self, f: F) -> MappedMutexGuard<'a, U>
F: FnOnce(&mut T) -> &mut U,
U: ?Sized,
{
// SAFETY: the conditions of `MutedGuard::new` were satisfied when the original guard
// SAFETY: the conditions of `MutexGuard::new` were satisfied when the original guard
// was created, and have been upheld throughout `map` and/or `try_map`.
// The signature of the closure guarantees that it will not "leak" the lifetime of the reference
// passed to it. If the closure panics, the guard will be dropped.
@ -751,7 +751,7 @@ pub fn try_map<U, F>(mut orig: Self, f: F) -> Result<MappedMutexGuard<'a, U>, Se
F: FnOnce(&mut T) -> Option<&mut U>,
U: ?Sized,
{
// SAFETY: the conditions of `MutedGuard::new` were satisfied when the original guard
// SAFETY: the conditions of `MutexGuard::new` were satisfied when the original guard
// was created, and have been upheld throughout `map` and/or `try_map`.
// The signature of the closure guarantees that it will not "leak" the lifetime of the reference
// passed to it. If the closure panics, the guard will be dropped.