diff --git a/Cargo.toml b/Cargo.toml index 16cd3f71d..2c3112b84 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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 "] license = "MIT" repository = "https://github.com/tokio-rs/tokio" diff --git a/src/lib.rs b/src/lib.rs index 5af9f68a2..e9e963689 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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 { diff --git a/src/unix/mod.rs b/src/unix/mod.rs index ad6f97d76..adf0f4ba2 100644 --- a/src/unix/mod.rs +++ b/src/unix/mod.rs @@ -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)) } diff --git a/src/unix/reap.rs b/src/unix/reap.rs index 567319b36..125aaf30f 100644 --- a/src/unix/reap.rs +++ b/src/unix/reap.rs @@ -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; diff --git a/src/windows.rs b/src/windows.rs index a368d510b..0d43f29fa 100644 --- a/src/windows.rs +++ b/src/windows.rs @@ -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)) }