From afbc34d07037626a61fe7143b1eff6d5c02a14a8 Mon Sep 17 00:00:00 2001 From: Jayce Fayne Date: Sat, 17 Apr 2021 14:18:59 +0200 Subject: [PATCH] fix clippy warnings --- src/lib.rs | 12 ++++++------ src/unix.rs | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 69de46d..caed818 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -777,9 +777,9 @@ impl Command { /// ``` pub fn spawn(&mut self) -> io::Result { let (stdin, stdout, stderr) = (self.stdin.take(), self.stdout.take(), self.stderr.take()); - self.inner.stdin(stdin.unwrap_or(Stdio::inherit())); - self.inner.stdout(stdout.unwrap_or(Stdio::inherit())); - self.inner.stderr(stderr.unwrap_or(Stdio::inherit())); + self.inner.stdin(stdin.unwrap_or_else(Stdio::inherit)); + self.inner.stdout(stdout.unwrap_or_else(Stdio::inherit)); + self.inner.stderr(stderr.unwrap_or_else(Stdio::inherit)); Child::new(self) } @@ -829,9 +829,9 @@ impl Command { /// ``` pub fn output(&mut self) -> impl Future> { let (stdin, stdout, stderr) = (self.stdin.take(), self.stdout.take(), self.stderr.take()); - self.inner.stdin(stdin.unwrap_or(Stdio::null())); - self.inner.stdout(stdout.unwrap_or(Stdio::piped())); - self.inner.stderr(stderr.unwrap_or(Stdio::piped())); + self.inner.stdin(stdin.unwrap_or_else(Stdio::null)); + self.inner.stdout(stdout.unwrap_or_else(Stdio::piped)); + self.inner.stderr(stderr.unwrap_or_else(Stdio::piped)); let child = Child::new(self); async { child?.output().await } diff --git a/src/unix.rs b/src/unix.rs index d1bb142..4208ecf 100644 --- a/src/unix.rs +++ b/src/unix.rs @@ -29,7 +29,7 @@ pub trait CommandExt { /// will be called and the spawn operation will immediately return with a /// failure. /// - /// # Notes and Safety + /// # Safety /// /// This closure will be run in the context of the child process after a /// `fork`. This primarily means that any modifications made to memory on