We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0327c30 commit 803beedCopy full SHA for 803beed
library/std/src/sync/nonpoison/mutex.rs
@@ -219,7 +219,13 @@ impl<T: ?Sized> Mutex<T> {
219
/// ```
220
#[unstable(feature = "nonpoison_mutex", issue = "134645")]
221
pub fn try_lock(&self) -> Option<MutexGuard<'_, T>> {
222
- unsafe { if self.inner.try_lock() { Some(MutexGuard::new(self)) } else { None } }
+ unsafe {
223
+ if self.inner.try_lock() {
224
+ Some(MutexGuard::new(self))
225
+ } else {
226
+ None
227
+ }
228
229
}
230
231
/// Consumes this mutex, returning the underlying data.
0 commit comments