mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-27 00:00:12 +02:00
Update Tokio to Rust 2018 (#1082)
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
extern crate tokio_executor;
|
||||
extern crate tokio_timer;
|
||||
|
||||
use tokio_timer::clock;
|
||||
use tokio_timer::clock::*;
|
||||
#![deny(warnings, rust_2018_idioms)]
|
||||
|
||||
use std::time::Instant;
|
||||
use tokio_executor;
|
||||
use tokio_timer::clock;
|
||||
use tokio_timer::clock::*;
|
||||
|
||||
struct ConstNow(Instant);
|
||||
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
#![deny(warnings, rust_2018_idioms)]
|
||||
#![allow(deprecated)]
|
||||
extern crate futures;
|
||||
extern crate tokio_executor;
|
||||
extern crate tokio_timer;
|
||||
|
||||
#[macro_use]
|
||||
mod support;
|
||||
use support::*;
|
||||
|
||||
use tokio_timer::*;
|
||||
use crate::support::*;
|
||||
|
||||
use futures::sync::oneshot;
|
||||
use futures::{future, Future};
|
||||
use tokio_timer::*;
|
||||
|
||||
#[test]
|
||||
fn simultaneous_deadline_future_completion() {
|
||||
|
||||
@@ -1,17 +1,12 @@
|
||||
extern crate futures;
|
||||
extern crate tokio_executor;
|
||||
extern crate tokio_timer;
|
||||
#![deny(warnings, rust_2018_idioms)]
|
||||
|
||||
#[macro_use]
|
||||
mod support;
|
||||
use support::*;
|
||||
|
||||
use tokio_timer::timer::Handle;
|
||||
use tokio_timer::*;
|
||||
use crate::support::*;
|
||||
|
||||
use futures::Future;
|
||||
|
||||
use std::time::{Duration, Instant};
|
||||
use tokio_timer::timer::Handle;
|
||||
use tokio_timer::*;
|
||||
|
||||
#[test]
|
||||
fn immediate_delay() {
|
||||
|
||||
@@ -1,21 +1,17 @@
|
||||
extern crate futures;
|
||||
extern crate rand;
|
||||
extern crate tokio_executor;
|
||||
extern crate tokio_timer;
|
||||
|
||||
use tokio_executor::park::{Park, Unpark, UnparkThread};
|
||||
use tokio_timer::*;
|
||||
#![deny(warnings, rust_2018_idioms)]
|
||||
|
||||
use futures::stream::FuturesUnordered;
|
||||
use futures::{Future, Stream};
|
||||
use rand;
|
||||
use rand::Rng;
|
||||
|
||||
use std::cmp;
|
||||
use std::sync::atomic::AtomicUsize;
|
||||
use std::sync::atomic::Ordering::SeqCst;
|
||||
use std::sync::{Arc, Barrier};
|
||||
use std::thread;
|
||||
use std::time::{Duration, Instant};
|
||||
use tokio_executor::park::{Park, Unpark, UnparkThread};
|
||||
use tokio_timer::*;
|
||||
|
||||
struct Signal {
|
||||
rem: AtomicUsize,
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
extern crate futures;
|
||||
extern crate tokio_executor;
|
||||
extern crate tokio_timer;
|
||||
#![deny(warnings, rust_2018_idioms)]
|
||||
|
||||
#[macro_use]
|
||||
mod support;
|
||||
use support::*;
|
||||
|
||||
use tokio_timer::*;
|
||||
use crate::support::*;
|
||||
|
||||
use futures::Stream;
|
||||
use tokio_timer::*;
|
||||
|
||||
#[test]
|
||||
#[should_panic]
|
||||
|
||||
@@ -1,16 +1,11 @@
|
||||
extern crate futures;
|
||||
extern crate tokio_executor;
|
||||
extern crate tokio_mock_task;
|
||||
extern crate tokio_timer;
|
||||
#![deny(warnings, rust_2018_idioms)]
|
||||
|
||||
#[macro_use]
|
||||
mod support;
|
||||
use support::*;
|
||||
|
||||
use tokio_mock_task::MockTask;
|
||||
use tokio_timer::*;
|
||||
use crate::support::*;
|
||||
|
||||
use futures::Stream;
|
||||
use tokio_mock_task::MockTask;
|
||||
use tokio_timer::*;
|
||||
|
||||
#[test]
|
||||
fn single_immediate_delay() {
|
||||
@@ -390,7 +385,7 @@ fn reset_first_expiring_item_to_expire_later() {
|
||||
let epoch = time.now();
|
||||
|
||||
let foo = queue.insert_at("foo", epoch + ms(200));
|
||||
let bar = queue.insert_at("bar", epoch + ms(250));
|
||||
let _bar = queue.insert_at("bar", epoch + ms(250));
|
||||
|
||||
task.enter(|| {
|
||||
assert_not_ready!(queue);
|
||||
|
||||
@@ -11,6 +11,7 @@ use std::rc::Rc;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! assert_ready {
|
||||
($f:expr) => {{
|
||||
use ::futures::Async::*;
|
||||
@@ -33,12 +34,14 @@ macro_rules! assert_ready {
|
||||
}}
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! assert_ready_eq {
|
||||
($f:expr, $expect:expr) => {
|
||||
assert_eq!($f.poll().unwrap(), ::futures::Async::Ready($expect));
|
||||
};
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! assert_not_ready {
|
||||
($f:expr) => {{
|
||||
let res = $f.poll().unwrap();
|
||||
@@ -53,6 +56,7 @@ macro_rules! assert_not_ready {
|
||||
}};
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! assert_elapsed {
|
||||
($f:expr) => {
|
||||
assert!($f.poll().unwrap_err().is_elapsed());
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
extern crate futures;
|
||||
extern crate tokio_executor;
|
||||
extern crate tokio_timer;
|
||||
#![deny(warnings, rust_2018_idioms)]
|
||||
|
||||
#[macro_use]
|
||||
mod support;
|
||||
use support::*;
|
||||
use crate::support::*;
|
||||
|
||||
use futures::{prelude::*, sync::mpsc};
|
||||
use tokio_timer::throttle::Throttle;
|
||||
|
||||
@@ -1,15 +1,11 @@
|
||||
extern crate futures;
|
||||
extern crate tokio_executor;
|
||||
extern crate tokio_timer;
|
||||
#![deny(warnings, rust_2018_idioms)]
|
||||
|
||||
#[macro_use]
|
||||
mod support;
|
||||
use support::*;
|
||||
|
||||
use tokio_timer::*;
|
||||
use crate::support::*;
|
||||
|
||||
use futures::sync::{mpsc, oneshot};
|
||||
use futures::{future, Future, Stream};
|
||||
use tokio_timer::*;
|
||||
|
||||
#[test]
|
||||
fn simultaneous_deadline_future_completion() {
|
||||
|
||||
Reference in New Issue
Block a user