Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/child_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ impl ChildExt for ChildContext<Child> {
{
let command = dyn_clone::clone_box(self.command.borrow());
match self.child.try_wait() {
Ok(status) => succeeded(TryWaitContext { status, command }),
Ok(status) => succeeded(TryWaitContext::new(status, command)),
Err(inner) => Err(Error::from(WaitError::new(command, inner)).into()),
}
}
Expand Down
9 changes: 7 additions & 2 deletions src/try_wait_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,16 @@ use crate::OutputContext;
///
/// See also: [`OutputContext`].
pub struct TryWaitContext {
pub(crate) status: Option<ExitStatus>,
pub(crate) command: Box<dyn CommandDisplay + Send + Sync>,
status: Option<ExitStatus>,
command: Box<dyn CommandDisplay + Send + Sync>,
}

impl TryWaitContext {
/// Construct a new [`TryWaitContext`].
pub fn new(status: Option<ExitStatus>, command: Box<dyn CommandDisplay + Send + Sync>) -> Self {
Self { status, command }
}

/// Get the result of the [`Child::try_wait`] call.
pub fn status(&self) -> Option<ExitStatus> {
self.status
Expand Down