]> git.proxmox.com Git - rustc.git/blobdiff - src/libstd/sync/mutex.rs
Imported Upstream version 1.9.0+dfsg1
[rustc.git] / src / libstd / sync / mutex.rs
index 34c9c7cf1e9e44c734e148ba7b47dc65e2ba61c5..e0946a5c12a77d25ccd077757a988e870192473e 100644 (file)
@@ -234,7 +234,7 @@ impl<T: ?Sized> Mutex<T> {
     pub fn try_lock(&self) -> TryLockResult<MutexGuard<T>> {
         unsafe {
             if self.inner.lock.try_lock() {
-                Ok(try!(MutexGuard::new(&*self.inner, &self.data)))
+                Ok(MutexGuard::new(&*self.inner, &self.data)?)
             } else {
                 Err(TryLockError::WouldBlock)
             }
@@ -353,7 +353,7 @@ impl StaticMutex {
     pub fn try_lock(&'static self) -> TryLockResult<MutexGuard<()>> {
         unsafe {
             if self.lock.try_lock() {
-                Ok(try!(MutexGuard::new(self, &DUMMY.0)))
+                Ok(MutexGuard::new(self, &DUMMY.0)?)
             } else {
                 Err(TryLockError::WouldBlock)
             }