Skip to content

Commit

Permalink
clippy and FreeBSD fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Maki325 committed Aug 27, 2024
1 parent b68da52 commit 9cc1bfb
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions tokio/src/process/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,20 +132,16 @@ impl Drop for ChildDropGuard {

impl ChildDropGuard {
pub(crate) fn new(child: StdChild) -> ChildDropGuard {
return ChildDropGuard {
ChildDropGuard {
child: Some(child),
kill_on_drop: true,
};
}
}

pub(crate) fn extract(mut self) -> StdChild {
self.child.take().unwrap()
}

pub(crate) fn dont_kill_on_drop(&mut self) {
self.kill_on_drop = false;
}

pub(crate) fn take_stdin(&mut self) -> Option<std::process::ChildStdin> {
self.child
.as_mut()
Expand All @@ -168,6 +164,12 @@ impl ChildDropGuard {
.take()
}

#[cfg(all(target_os = "linux", feature = "rt"))]
pub(crate) fn dont_kill_on_drop(&mut self) {
self.kill_on_drop = false;
}

#[cfg(all(target_os = "linux", feature = "rt"))]
pub(crate) fn inner_mut(&mut self) -> &mut StdChild {
self.child.as_mut().expect("child has gone away")
}
Expand Down

0 comments on commit 9cc1bfb

Please sign in to comment.