diff options
author | Alan Somers <asomers@gmail.com> | 2018-12-08 13:47:33 -0700 |
---|---|---|
committer | Alan Somers <asomers@gmail.com> | 2018-12-08 13:51:43 -0700 |
commit | ca035734df2e3dfeb866cbfee51de7b582be83f5 (patch) | |
tree | dbbf94ee5189b13ea4d448ba63512b43f85b4ba8 /src/sys/wait.rs | |
parent | 5a3ac8df3fa2de86477d961d8b5720b1d283b2d5 (diff) | |
download | nix-ca035734df2e3dfeb866cbfee51de7b582be83f5.zip |
Replace try! with ?
try! is not available in Rust 2018
Diffstat (limited to 'src/sys/wait.rs')
-rw-r--r-- | src/sys/wait.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/sys/wait.rs b/src/sys/wait.rs index 038354b1..3f99757d 100644 --- a/src/sys/wait.rs +++ b/src/sys/wait.rs @@ -181,7 +181,7 @@ impl WaitStatus { Ok(if exited(status) { WaitStatus::Exited(pid, exit_status(status)) } else if signaled(status) { - WaitStatus::Signaled(pid, try!(term_signal(status)), dumped_core(status)) + WaitStatus::Signaled(pid, term_signal(status)?, dumped_core(status)) } else if stopped(status) { cfg_if! { if #[cfg(any(target_os = "android", target_os = "linux"))] { @@ -190,14 +190,15 @@ impl WaitStatus { Ok(if syscall_stop(status) { WaitStatus::PtraceSyscall(pid) } else if status_additional == 0 { - WaitStatus::Stopped(pid, try!(stop_signal(status))) + WaitStatus::Stopped(pid, stop_signal(status)?) } else { - WaitStatus::PtraceEvent(pid, try!(stop_signal(status)), stop_additional(status)) + WaitStatus::PtraceEvent(pid, stop_signal(status)?, + stop_additional(status)) }) } } else { fn decode_stopped(pid: Pid, status: i32) -> Result<WaitStatus> { - Ok(WaitStatus::Stopped(pid, try!(stop_signal(status)))) + Ok(WaitStatus::Stopped(pid, stop_signal(status)?)) } } } @@ -227,7 +228,7 @@ pub fn waitpid<P: Into<Option<Pid>>>(pid: P, options: Option<WaitPidFlag>) -> Re ) }; - match try!(Errno::result(res)) { + match Errno::result(res)? { 0 => Ok(StillAlive), res => WaitStatus::from_raw(Pid::from_raw(res), status), } |