Skip to content

Commit 5aa6298

Browse files
committed
stderr_logging clean up
convert CmdIn to PipeReader
1 parent b3d3b02 commit 5aa6298

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/child.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use crate::io::CmdIn;
21
use crate::CmdResult;
32
use log::info;
43
use os_pipe::PipeReader;
@@ -15,12 +14,12 @@ pub enum CmdChild {
1514
ThreadChild {
1615
child: JoinHandle<CmdResult>,
1716
cmd: String,
18-
stderr: Option<CmdIn>,
17+
stderr: Option<PipeReader>,
1918
},
2019
SyncChild {
2120
output: Option<PipeReader>,
2221
cmd: String,
23-
stderr: Option<CmdIn>,
22+
stderr: Option<PipeReader>,
2423
},
2524
}
2625

src/process.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ pub struct Cmd {
353353
stdin_redirect: Option<CmdIn>,
354354
stdout_redirect: Option<CmdOut>,
355355
stderr_redirect: Option<CmdOut>,
356-
stderr_logging: Option<CmdIn>, // for builtin/custom commands
356+
stderr_logging: Option<PipeReader>, // for builtin/custom commands
357357
}
358358

359359
impl Default for Cmd {
@@ -575,7 +575,7 @@ impl Cmd {
575575
// set up error pipe
576576
let (pipe_reader, pipe_writer) = os_pipe::pipe()?;
577577
self.stderr_redirect = Some(CmdOut::CmdPipe(pipe_writer));
578-
self.stderr_logging = Some(CmdIn::CmdPipe(pipe_reader));
578+
self.stderr_logging = Some(pipe_reader);
579579
}
580580

581581
if let Some(pipe) = pipe_in.take() {

0 commit comments

Comments
 (0)