Skip to content

Commit c0f5532

Browse files
committed
fix position of enabling feature
1 parent eb1dd3c commit c0f5532

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

library/std/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -409,9 +409,9 @@
409409
#![feature(edition_panic)]
410410
#![feature(format_args_nl)]
411411
#![feature(log_syntax)]
412+
#![feature(nonpoison_mutex)]
412413
#![feature(test)]
413414
#![feature(trace_macros)]
414-
#![feature(nonpoison_mutex)]
415415
// tidy-alphabetical-end
416416
//
417417
// Only used in tests/benchmarks:

library/std/src/sync/nonpoison/mutex.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -219,13 +219,7 @@ impl<T: ?Sized> Mutex<T> {
219219
/// ```
220220
#[unstable(feature = "nonpoison_mutex", issue = "134645")]
221221
pub fn try_lock(&self) -> Option<MutexGuard<'_, T>> {
222-
unsafe {
223-
if self.inner.try_lock() {
224-
Some(MutexGuard::new(self))
225-
} else {
226-
None
227-
}
228-
}
222+
unsafe { if self.inner.try_lock() { Some(MutexGuard::new(self)) } else { None } }
229223
}
230224

231225
/// Consumes this mutex, returning the underlying data.

0 commit comments

Comments
 (0)