Skip to content

Commit 2727f82

Browse files
committed
std: unix process_unsupported: Provide a wait status emulation (fmt)
Worsify formatting as required by rustfmt.
1 parent 9738a07 commit 2727f82

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

library/std/src/sys/unix/process/process_unsupported/wait_status.rs

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,12 @@ impl ExitStatus {
3737
// Likewise the macros disregard all the high bits, so are happy to declare
3838
// out-of-range values to be WIFEXITED, WIFSTOPPED, etc.
3939
let w = self.wait_status;
40-
if (w & 0x7f) == 0 {
41-
Some((w & 0xff00) >> 8)
42-
} else {
43-
None
44-
}
40+
if (w & 0x7f) == 0 { Some((w & 0xff00) >> 8) } else { None }
4541
}
4642

4743
pub fn signal(&self) -> Option<i32> {
4844
let signal = self.wait_status & 0x007f;
49-
if signal > 0 && signal < 0x7f {
50-
Some(signal)
51-
} else {
52-
None
53-
}
45+
if signal > 0 && signal < 0x7f { Some(signal) } else { None }
5446
}
5547

5648
pub fn core_dumped(&self) -> bool {
@@ -59,11 +51,7 @@ impl ExitStatus {
5951

6052
pub fn stopped_signal(&self) -> Option<i32> {
6153
let w = self.wait_status;
62-
if (w & 0xff) == 0x7f {
63-
Some((w & 0xff00) >> 8)
64-
} else {
65-
None
66-
}
54+
if (w & 0xff) == 0x7f { Some((w & 0xff00) >> 8) } else { None }
6755
}
6856

6957
pub fn continued(&self) -> bool {

0 commit comments

Comments
 (0)