Skip to content

Commit cab8c2a

Browse files
committed
std: _lock -> _guard in Mutex example
The comment in the next line was already talking about `_guard`, and the scope guard a couple lines further down is also called `guard`, so I assume that was just a typo.
1 parent e06f692 commit cab8c2a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libstd/sync/mutex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ use sys_common::poison::{self, TryLockError, TryLockResult, LockResult};
9696
/// let _ = thread::spawn(move || -> () {
9797
/// // This thread will acquire the mutex first, unwrapping the result of
9898
/// // `lock` because the lock has not been poisoned.
99-
/// let _lock = lock2.lock().unwrap();
99+
/// let _guard = lock2.lock().unwrap();
100100
///
101101
/// // This panic while holding the lock (`_guard` is in scope) will poison
102102
/// // the mutex.

0 commit comments

Comments
 (0)