process: Update to 2018 edition

This commit is contained in:
Ivan Petkov 2019-06-24 17:29:04 -07:00
parent 27c15471c1
commit cb8607a816
No known key found for this signature in database
GPG Key ID: 0B431E9837056942
5 changed files with 9 additions and 8 deletions

View File

@ -5,6 +5,7 @@ name = "tokio-process"
# - Update CHANGELOG.md.
# - Create "X.Y.Z" git tag.
version = "0.2.4"
edition = "2018"
authors = ["Tokio Contributors <team@tokio.rs>"]
license = "MIT"
repository = "https://github.com/tokio-rs/tokio"

View File

@ -172,9 +172,9 @@ extern crate log;
use std::io::{self, Read, Write};
use std::process::{Command, ExitStatus, Output, Stdio};
use crate::kill::Kill;
use futures::future::{ok, Either};
use futures::{Async, Future, IntoFuture, Poll};
use kill::Kill;
use std::fmt;
use tokio_io::io::read_to_end;
use tokio_io::{AsyncRead, AsyncWrite, IoFuture};
@ -759,8 +759,8 @@ mod sys {
#[cfg(test)]
mod test {
use super::ChildDropGuard;
use crate::kill::Kill;
use futures::{Async, Future, Poll};
use kill::Kill;
use std::io;
struct Mock {

View File

@ -35,9 +35,9 @@ use self::orphan::{AtomicOrphanQueue, OrphanQueue, Wait};
use self::reap::Reaper;
use self::tokio_signal::unix::Signal;
use super::SpawnedChild;
use crate::kill::Kill;
use futures::future::FlattenStream;
use futures::{Future, Poll};
use kill::Kill;
use std::fmt;
use std::io;
use std::os::unix::io::{AsRawFd, RawFd};
@ -216,6 +216,6 @@ where
return Err(io::Error::last_os_error());
}
}
let io = try!(PollEvented::new_with_handle(Fd(io), handle));
let io = PollEvented::new_with_handle(Fd(io), handle)?;
Ok(Some(io))
}

View File

@ -1,6 +1,6 @@
use super::orphan::{OrphanQueue, Wait};
use crate::kill::Kill;
use futures::{Async, Future, Poll, Stream};
use kill::Kill;
use std::io;
use std::ops::Deref;
use std::process::ExitStatus;

View File

@ -106,11 +106,11 @@ impl Future for Child {
Async::Ready(()) => {}
Async::NotReady => return Ok(Async::NotReady),
}
let status = try!(try_wait(&self.child)).expect("not ready yet");
let status = try_wait(&self.child)?.expect("not ready yet");
return Ok(status.into());
}
if let Some(e) = try!(try_wait(&self.child)) {
if let Some(e) = try_wait(&self.child)? {
return Ok(e.into());
}
let (tx, rx) = oneshot::channel();
@ -187,6 +187,6 @@ where
None => return Ok(None),
};
let pipe = unsafe { NamedPipe::from_raw_handle(io.into_raw_handle()) };
let io = try!(PollEvented::new_with_handle(pipe, handle));
let io = PollEvented::new_with_handle(pipe, handle)?;
Ok(Some(io))
}