diff options
| author | Jorge Aparicio <japaricious@gmail.com> | 2016-03-22 22:01:37 -0500 |
|---|---|---|
| committer | Jorge Aparicio <japaricious@gmail.com> | 2016-03-22 22:01:37 -0500 |
| commit | 0f02309e4b0ea05ee905205278fb6d131341c41f (patch) | |
| tree | a259129eeb84705de15b51587ddebd0f82735075 /src/libstd/sync | |
| parent | 0dcc413e42f15f4fc51a0ca88a99cc89454ec43d (diff) | |
| download | rust-0f02309e4b0ea05ee905205278fb6d131341c41f.tar.gz rust-0f02309e4b0ea05ee905205278fb6d131341c41f.zip | |
try! -> ?
Automated conversion using the untry tool [1] and the following command: ``` $ find -name '*.rs' -type f | xargs untry ``` at the root of the Rust repo. [1]: https://github.com/japaric/untry
Diffstat (limited to 'src/libstd/sync')
| -rw-r--r-- | src/libstd/sync/mutex.rs | 4 | ||||
| -rw-r--r-- | src/libstd/sync/rwlock.rs | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/libstd/sync/mutex.rs b/src/libstd/sync/mutex.rs index 34c9c7cf1e9..e0946a5c12a 100644 --- a/src/libstd/sync/mutex.rs +++ b/src/libstd/sync/mutex.rs @@ -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) } diff --git a/src/libstd/sync/rwlock.rs b/src/libstd/sync/rwlock.rs index 0603dad4528..a37c1c16a45 100644 --- a/src/libstd/sync/rwlock.rs +++ b/src/libstd/sync/rwlock.rs @@ -205,7 +205,7 @@ impl<T: ?Sized> RwLock<T> { pub fn try_read(&self) -> TryLockResult<RwLockReadGuard<T>> { unsafe { if self.inner.lock.try_read() { - Ok(try!(RwLockReadGuard::new(&*self.inner, &self.data))) + Ok(RwLockReadGuard::new(&*self.inner, &self.data)?) } else { Err(TryLockError::WouldBlock) } @@ -257,7 +257,7 @@ impl<T: ?Sized> RwLock<T> { pub fn try_write(&self) -> TryLockResult<RwLockWriteGuard<T>> { unsafe { if self.inner.lock.try_write() { - Ok(try!(RwLockWriteGuard::new(&*self.inner, &self.data))) + Ok(RwLockWriteGuard::new(&*self.inner, &self.data)?) } else { Err(TryLockError::WouldBlock) } @@ -382,7 +382,7 @@ impl StaticRwLock { -> TryLockResult<RwLockReadGuard<'static, ()>> { unsafe { if self.lock.try_read(){ - Ok(try!(RwLockReadGuard::new(self, &DUMMY.0))) + Ok(RwLockReadGuard::new(self, &DUMMY.0)?) } else { Err(TryLockError::WouldBlock) } @@ -409,7 +409,7 @@ impl StaticRwLock { -> TryLockResult<RwLockWriteGuard<'static, ()>> { unsafe { if self.lock.try_write() { - Ok(try!(RwLockWriteGuard::new(self, &DUMMY.0))) + Ok(RwLockWriteGuard::new(self, &DUMMY.0)?) } else { Err(TryLockError::WouldBlock) } |
