From a3e41b57593cb58729f0761e0cf9f25db5639af6 Mon Sep 17 00:00:00 2001 From: the8472 Date: Mon, 20 Mar 2023 12:07:27 +0100 Subject: Apply suggestions from code review Co-authored-by: Josh Stone --- library/std/src/sync/mutex.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'library/std') 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 -- cgit 1.4.1-3-g733a5