mirror of https://github.com/smol-rs/async-dup
Fix clippy::manual_map warning
This commit is contained in:
parent
d106d4d581
commit
b3e1ff86de
|
@ -272,11 +272,7 @@ impl<T> Mutex<T> {
|
|||
/// # ;
|
||||
/// ```
|
||||
pub fn try_lock(&self) -> Option<MutexGuard<'_, T>> {
|
||||
if let Some(guard) = self.0.try_lock() {
|
||||
Some(MutexGuard(guard))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
self.0.try_lock().map(MutexGuard)
|
||||
}
|
||||
|
||||
/// Consumes the mutex, returning the underlying data.
|
||||
|
|
Loading…
Reference in New Issue