Add From<u8> for ExitCode

This should cover a mostly cross-platform subset of supported exit codes.
This commit is contained in:
Jane Lusby
2022-01-28 14:07:27 -08:00
committed by David Tolnay
parent f624427f87
commit cf4ac6b1e1
4 changed files with 29 additions and 0 deletions

View File

@@ -162,6 +162,15 @@ impl ExitCode {
}
}
impl From<u8> for ExitCode {
fn from(code: u8) -> Self {
match code {
0 => Self::SUCCESS,
1..255 => Self::FAILURE,
}
}
}
pub struct Process(!);
impl Process {