A lot of Command::new are spawned twice as .status() and .output() internally spawn a process and wait for it to complete. Only one should be used .output() which also contains .status.
They also panic after completion if an error occurred when spawning the command by using .expect().
Note that .status and .output have different output capturing semantics, mainly that .status pipes and .output captures into fields, so this also has to be kept in mind.
A lot of
Command::new
are spawned twice as.status()
and.output()
internally spawn a process and wait for it to complete. Only one should be used.output()
which also contains.status
.They also panic after completion if an error occurred when spawning the command by using
.expect()
.Eg. https://github.com/mario-eth/soldeer/blob/660b6c95e33965e532dabedce30d0e48c5d174bc/src/dependency_downloader.rs#L220-L230
Note that
.status
and.output
have different output capturing semantics, mainly that .status pipes and .output captures into fields, so this also has to be kept in mind.