mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
std: unix process_unsupported: Provide a wait status emulation (fmt)
Worsify formatting as required by rustfmt.
This commit is contained in:
parent
9738a07f98
commit
2727f82526
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user