about summary refs log tree commit diff
diff options
context:
space:
mode:
authorthe8472 <the8472@users.noreply.github.com>2023-03-20 12:07:27 +0100
committerThe 8472 <git@infinite-source.de>2023-03-20 12:15:17 +0100
commita3e41b57593cb58729f0761e0cf9f25db5639af6 (patch)
treecb8d2d5807f0c182c3ed82481c90191aed7e1bb7
parentdb5dfd2373fb6774bf7d95f3dbab0818415f421b (diff)
downloadrust-a3e41b57593cb58729f0761e0cf9f25db5639af6.tar.gz
rust-a3e41b57593cb58729f0761e0cf9f25db5639af6.zip
Apply suggestions from code review
Co-authored-by: Josh Stone <cuviper@gmail.com>
-rw-r--r--library/std/src/sync/mutex.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/library/std/src/sync/mutex.rs b/library/std/src/sync/mutex.rs
index 2f7c609c83e..b8fec6902a0 100644
--- a/library/std/src/sync/mutex.rs
+++ b/library/std/src/sync/mutex.rs
@@ -107,8 +107,8 @@ use crate::sys::locks as sys;
 /// *guard += 1;
 /// ```
 ///
-/// It is sometimes necessary to manually drop the mutex guard or to create an inner scope
-/// to unlock it sooner than the end of the enclosing scope.
+/// To unlock a mutex guard sooner than the end of the enclosing scope,
+/// either create an inner scope or drop the guard manually.
 ///
 /// ```
 /// use std::sync::{Arc, Mutex};
@@ -153,7 +153,7 @@ use crate::sys::locks as sys;
 /// // It's even more important here than in the threads because we `.join` the
 /// // threads after that. If we had not dropped the mutex guard, a thread could
 /// // be waiting forever for it, causing a deadlock.
-/// // As in the threads a block could have been used instead of calling the
+/// // As in the threads, a block could have been used instead of calling the
 /// // `drop` function.
 /// drop(data);
 /// // Here the mutex guard is not assigned to a variable and so, even if the