We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c9bb935 commit ccc019aCopy full SHA for ccc019a
src/libstd/process.rs
@@ -671,9 +671,6 @@ impl Command {
671
672
#[stable(feature = "rust1", since = "1.0.0")]
673
impl fmt::Debug for Command {
674
- /// Format the program and arguments of a Command for display. Any
675
- /// non-utf8 data is lossily converted using the utf8 replacement
676
- /// character.
677
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
678
self.inner.fmt(f)
679
}
src/libstd/sys/unix/process/process_common.rs
@@ -81,6 +81,7 @@ pub enum ChildStdio {
81
Owned(FileDesc),
82
83
84
+#[derive(Debug)]
85
pub enum Stdio {
86
Inherit,
87
Null,
@@ -351,11 +352,20 @@ fn pair_to_key(key: &OsStr, value: &OsStr, saw_nul: &mut bool) -> CString {
351
352
353
354
- write!(f, "{:?}", self.program)?;
355
- for arg in &self.args {
356
- write!(f, " {:?}", arg)?;
357
- }
358
- Ok(())
+ f.debug_struct("Command")
+ .field("program", &self.program)
+ .field("args", &self.args)
+ .field("env", &self.env)
359
+ .field("argv", &self.argv)
360
+ .field("envp", &self.envp)
361
+ .field("cwd", &self.cwd)
362
+ .field("uid", &self.uid)
363
+ .field("gid", &self.gid)
364
+ .field("saw_nul", &self.saw_nul)
365
+ .field("stdin", &self.stdin)
366
+ .field("stdout", &self.stdout)
367
+ .field("stderr", &self.stderr)
368
+ .finish()
369
370
371
0 commit comments