It would be useful if std::process::ExitStatus implemented std::ops::Try. This could reduce boilerplate code where multiple Commands need to be spawned and checked.
Open question: What's a good error type? ExitStatus itself already contains all the relevant error information from the command, but being able to return a result of Err(ExitStatus::from_code(0)) would be weird. (Thanks @scottmcm for pointing this out.)
It would be useful if
std::process::ExitStatusimplementedstd::ops::Try. This could reduce boilerplate code where multipleCommands need to be spawned and checked.Open question: What's a good error type?
ExitStatusitself already contains all the relevant error information from the command, but being able to return a result ofErr(ExitStatus::from_code(0))would be weird. (Thanks @scottmcm for pointing this out.)