// option. This file may not be copied, modified, or distributed
// except according to those terms.
-use prelude::v1::*;
-
use fmt;
use marker;
use ops::Deref;
/// acquired.
pub fn try_lock(&self) -> TryLockResult<ReentrantMutexGuard<T>> {
if unsafe { self.inner.try_lock() } {
- Ok(try!(ReentrantMutexGuard::new(&self)))
+ Ok(ReentrantMutexGuard::new(&self)?)
} else {
Err(TryLockError::WouldBlock)
}
#[cfg(test)]
mod tests {
- use prelude::v1::*;
use sys_common::remutex::{ReentrantMutex, ReentrantMutexGuard};
use cell::RefCell;
use sync::Arc;