You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rollup merge of rust-lang#99214 - beyarkay:patch-1, r=thomcc
docs: show how to stringify the output of Command
This documentation-only change clarifies how the user can get the string representation of the output of a command.
The `stdout` and `stderr` members of `std::process::Output` from `std::process::Command` return a Vec<u8>, which is not always what the user wants.
For simple cases like printing `stderr` iff the `std::process::ExitStatus` is non-zero, it's useful to get the string representation of this `Vec<u8>`. This can be done via `String::from_utf8_lossy`, but it's not clear that this is possible from the documentation without first searching the internet for an answer.
Link to playground: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=8189f65dc4b354a643311af2cea5b230
0 commit comments