summaryrefslogtreecommitdiffstats
path: root/tokio-test/src/io.rs
diff options
context:
space:
mode:
authorCarl Lerche <me@carllerche.com>2019-10-21 16:45:13 -0700
committerGitHub <noreply@github.com>2019-10-21 16:45:13 -0700
commitb8cee1a60ad99ef28ec494ae4230e2ef4399fcf9 (patch)
tree5bde8f840d2450397beb3403141802f558ff1147 /tokio-test/src/io.rs
parentc9bcbe77b9fa36868cc94cc75426823c7ec205ac (diff)
timer: move `tokio-timer` into `tokio` crate (#1674)
A step towards collapsing Tokio sub crates into a single `tokio` crate (#1318). The `timer` implementation is now provided by the main `tokio` crate. The `timer` functionality may still be excluded from the build by skipping the `timer` feature flag.
Diffstat (limited to 'tokio-test/src/io.rs')
-rw-r--r--tokio-test/src/io.rs46
1 files changed, 5 insertions, 41 deletions
diff --git a/tokio-test/src/io.rs b/tokio-test/src/io.rs
index ffbb07c5..6610c1db 100644
--- a/tokio-test/src/io.rs
+++ b/tokio-test/src/io.rs
@@ -16,6 +16,11 @@
//! [`AsyncRead`]: tokio_io::AsyncRead
//! [`AsyncWrite`]: tokio_io::AsyncWrite
+use tokio::timer::{clock, timer, Delay};
+use tokio_io::{AsyncRead, AsyncWrite, Buf};
+use tokio_sync::mpsc;
+
+use futures_core::ready;
use std::collections::VecDeque;
use std::future::Future;
use std::pin::Pin;
@@ -23,11 +28,6 @@ use std::task::{self, Poll, Waker};
use std::time::{Duration, Instant};
use std::{cmp, io};
-use futures_core::ready;
-use tokio_io::{AsyncRead, AsyncWrite, Buf};
-use tokio_sync::mpsc;
-use tokio_timer::{clock, timer, Delay};
-
/// An I/O object that follows a predefined script.
///
/// This value is created by `Builder` and implements `AsyncRead` + `AsyncWrite`. It
@@ -268,42 +268,6 @@ impl Inner {
}
}
-/*
-impl io::Read for Mock {
- fn read(&mut self, dst: &mut [u8]) -> io::Result<usize> {
- if self.is_async() {
- tokio::async_read(self, dst)
- } else {
- self.sync_read(dst)
- }
- }
-}
-
-impl io::Write for Mock {
- fn write(&mut self, src: &[u8]) -> io::Result<usize> {
- if self.is_async() {
- tokio::async_write(self, src)
- } else {
- self.sync_write(src)
- }
- }
-
- fn flush(&mut self) -> io::Result<()> {
- Ok(())
- }
-}
-*/
-
-/*
-use self::futures::{Future, Stream, Poll, Async};
-use self::futures::sync::mpsc;
-use self::futures::task::{self, Task};
-use self::tokio_io::{AsyncRead, AsyncWrite};
-use self::tokio_timer::{Timer, Sleep};
-
-use std::io;
-*/
-
// ===== impl Inner =====
impl Mock {