diff options
| author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2023-08-22 19:02:06 +0100 |
|---|---|---|
| committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2023-08-22 19:02:06 +0100 |
| commit | 2727f82526ba1191ed6faaa5ab118833aa2fffdf (patch) | |
| tree | ac10da3264158e73e92ac5d6db7de40d9fac9327 /library/std/src/sys | |
| parent | 9738a07f986eb6c59ad309e66fa5f94a95d91309 (diff) | |
| download | rust-2727f82526ba1191ed6faaa5ab118833aa2fffdf.tar.gz rust-2727f82526ba1191ed6faaa5ab118833aa2fffdf.zip | |
std: unix process_unsupported: Provide a wait status emulation (fmt)
Worsify formatting as required by rustfmt.
Diffstat (limited to 'library/std/src/sys')
| -rw-r--r-- | library/std/src/sys/unix/process/process_unsupported/wait_status.rs | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/library/std/src/sys/unix/process/process_unsupported/wait_status.rs b/library/std/src/sys/unix/process/process_unsupported/wait_status.rs index 17004779a62..f465946a528 100644 --- a/library/std/src/sys/unix/process/process_unsupported/wait_status.rs +++ b/library/std/src/sys/unix/process/process_unsupported/wait_status.rs @@ -37,20 +37,12 @@ impl ExitStatus { // Likewise the macros disregard all the high bits, so are happy to declare // out-of-range values to be WIFEXITED, WIFSTOPPED, etc. let w = self.wait_status; - if (w & 0x7f) == 0 { - Some((w & 0xff00) >> 8) - } else { - None - } + if (w & 0x7f) == 0 { Some((w & 0xff00) >> 8) } else { None } } pub fn signal(&self) -> Option<i32> { let signal = self.wait_status & 0x007f; - if signal > 0 && signal < 0x7f { - Some(signal) - } else { - None - } + if signal > 0 && signal < 0x7f { Some(signal) } else { None } } pub fn core_dumped(&self) -> bool { @@ -59,11 +51,7 @@ impl ExitStatus { pub fn stopped_signal(&self) -> Option<i32> { let w = self.wait_status; - if (w & 0xff) == 0x7f { - Some((w & 0xff00) >> 8) - } else { - None - } + if (w & 0xff) == 0x7f { Some((w & 0xff00) >> 8) } else { None } } pub fn continued(&self) -> bool { |
