Rollup merge of #95058 - wcampbell0x2a:use-then-in-unix-process, r=dtolnay
Add use of bool::then in sys/unix/process Remove `else { None }` in favor of using `bool::then()`
This commit is contained in:
commit
c8cf9e3a8f
@ -648,11 +648,11 @@ impl ExitStatus {
|
||||
}
|
||||
|
||||
pub fn code(&self) -> Option<i32> {
|
||||
if self.exited() { Some(libc::WEXITSTATUS(self.0)) } else { None }
|
||||
self.exited().then(|| libc::WEXITSTATUS(self.0))
|
||||
}
|
||||
|
||||
pub fn signal(&self) -> Option<i32> {
|
||||
if libc::WIFSIGNALED(self.0) { Some(libc::WTERMSIG(self.0)) } else { None }
|
||||
libc::WIFSIGNALED(self.0).then(|| libc::WTERMSIG(self.0))
|
||||
}
|
||||
|
||||
pub fn core_dumped(&self) -> bool {
|
||||
@ -660,7 +660,7 @@ impl ExitStatus {
|
||||
}
|
||||
|
||||
pub fn stopped_signal(&self) -> Option<i32> {
|
||||
if libc::WIFSTOPPED(self.0) { Some(libc::WSTOPSIG(self.0)) } else { None }
|
||||
libc::WIFSTOPPED(self.0).then(|| libc::WSTOPSIG(self.0))
|
||||
}
|
||||
|
||||
pub fn continued(&self) -> bool {
|
||||
|
Loading…
x
Reference in New Issue
Block a user