Clarify the scope-related explanation

Based on the review made by dtolnay.
This commit is contained in:
Poliorcetics 2020-06-13 18:43:37 +02:00 committed by GitHub
parent f747073fc1
commit 34b3ff06e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -108,9 +108,8 @@ use crate::sys_common::poison::{self, LockResult, TryLockError, TryLockResult};
/// *guard += 1;
/// ```
///
/// It is sometimes necessary to manually drop the mutex
/// guard to unlock it as soon as possible. If you need the resource until the end of
/// the scope, this is not needed.
/// It is sometimes necessary to manually drop the mutex guard
/// to unlock it sooner than the end of the enclosing scope.
///
/// ```
/// use std::sync::{Arc, Mutex};