Skip to content

Commit

Permalink
Debug formatting of raw_arg()
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Jul 9, 2021
1 parent 8f9d0f1 commit bc67f6b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions library/std/src/sys/windows/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,13 @@ impl Command {

impl fmt::Debug for Command {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{:?}", self.program)?;
self.program.fmt(f)?;
for arg in &self.args {
write!(f, " {:?}", arg)?;
f.write_str(" ")?;
match arg {
Arg::Regular(s) => s.fmt(f),
Arg::Raw(s) => f.write_str(&s.to_string_lossy()),
}?;
}
Ok(())
}
Expand Down

0 comments on commit bc67f6b

Please sign in to comment.