Merge pull request #14 from JayceFayne/clippy

fix clippy warnings
This commit is contained in:
Taiki Endo 2021-04-17 21:29:33 +09:00 committed by GitHub
commit 716cc8aa01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View File

@ -777,9 +777,9 @@ impl Command {
/// ``` /// ```
pub fn spawn(&mut self) -> io::Result<Child> { pub fn spawn(&mut self) -> io::Result<Child> {
let (stdin, stdout, stderr) = (self.stdin.take(), self.stdout.take(), self.stderr.take()); let (stdin, stdout, stderr) = (self.stdin.take(), self.stdout.take(), self.stderr.take());
self.inner.stdin(stdin.unwrap_or(Stdio::inherit())); self.inner.stdin(stdin.unwrap_or_else(Stdio::inherit));
self.inner.stdout(stdout.unwrap_or(Stdio::inherit())); self.inner.stdout(stdout.unwrap_or_else(Stdio::inherit));
self.inner.stderr(stderr.unwrap_or(Stdio::inherit())); self.inner.stderr(stderr.unwrap_or_else(Stdio::inherit));
Child::new(self) Child::new(self)
} }
@ -829,9 +829,9 @@ impl Command {
/// ``` /// ```
pub fn output(&mut self) -> impl Future<Output = io::Result<Output>> { pub fn output(&mut self) -> impl Future<Output = io::Result<Output>> {
let (stdin, stdout, stderr) = (self.stdin.take(), self.stdout.take(), self.stderr.take()); let (stdin, stdout, stderr) = (self.stdin.take(), self.stdout.take(), self.stderr.take());
self.inner.stdin(stdin.unwrap_or(Stdio::null())); self.inner.stdin(stdin.unwrap_or_else(Stdio::null));
self.inner.stdout(stdout.unwrap_or(Stdio::piped())); self.inner.stdout(stdout.unwrap_or_else(Stdio::piped));
self.inner.stderr(stderr.unwrap_or(Stdio::piped())); self.inner.stderr(stderr.unwrap_or_else(Stdio::piped));
let child = Child::new(self); let child = Child::new(self);
async { child?.output().await } async { child?.output().await }

View File

@ -29,7 +29,7 @@ pub trait CommandExt {
/// will be called and the spawn operation will immediately return with a /// will be called and the spawn operation will immediately return with a
/// failure. /// failure.
/// ///
/// # Notes and Safety /// # Safety
/// ///
/// This closure will be run in the context of the child process after a /// 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 /// `fork`. This primarily means that any modifications made to memory on