-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Description
At the moment, Command
does not implement Display
. However, it's often useful to display Command
for the end user, the most common case being that the command failed, and you want to display an error message. If cmd.to_string()
returned something like cargo --metadata --manifest-path ./foo/Cargo.toml
, that would be sweet.
It's also instructive to compare it with Path
s. Path
deliberately doesn't implement display directly, and the reason for that (I think) is not to make people thing about non-text path when displaing paths, but to make it harder to miss-use string formatting for path operations. IE, we don't want to people doing
let path = PathBuf::from(format!("{}/{}", base, name))
, as that doesn't handle bag-of-bytes paths.
For Command
, I don't think to_string()
can be missused in a similar manner, so adding Display
seems like a clear win to me.