Skip to content

Commit

Permalink
Merge pull request #58 from tomaka/tokio-core-dep
Browse files Browse the repository at this point in the history
Remove the tokio-core dependency where not necessary
  • Loading branch information
tomaka authored Dec 7, 2017
2 parents b0062ba + 7abd400 commit cd40755
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 21 deletions.
2 changes: 1 addition & 1 deletion libp2p-peerstore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ datastore = { path = "../datastore" }
futures = "0.1.0"
owning_ref = "0.3.3"
multiaddr = "0.2"
multihash = "0.7.0"
serde = "1.0"
serde_derive = "1.0"

[dev-dependencies]
multihash = "0.7.0"
tempfile = "2.2"
1 change: 0 additions & 1 deletion libp2p-peerstore/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ extern crate base58;
extern crate datastore;
extern crate futures;
extern crate multiaddr;
extern crate multihash;
extern crate owning_ref;
extern crate serde;
#[macro_use]
Expand Down
2 changes: 1 addition & 1 deletion libp2p-peerstore/src/peerstore_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@

macro_rules! peerstore_tests {
({$create_peerstore:expr} $({$stmt:stmt})*) => {
extern crate multihash;
use std::thread;
use std::time::Duration;
use {Peerstore, PeerAccess};
use multiaddr::Multiaddr;
use multihash;

#[test]
fn initially_empty() {
Expand Down
4 changes: 3 additions & 1 deletion libp2p-secio/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ rand = "0.3.17"
ring = { version = "0.12.1", features = ["rsa_signing"] }
rust-crypto = "^0.2"
rw-stream-sink = { path = "../rw-stream-sink" }
tokio-core = "0.1.6"
tokio-io = "0.1.0"
untrusted = "0.6.0"

[dev-dependencies]
tokio-core = "0.1.6"
7 changes: 4 additions & 3 deletions libp2p-secio/src/codec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ pub fn full_codec<S>(

#[cfg(test)]
mod tests {
extern crate tokio_core;
use super::DecoderMiddleware;
use super::EncoderMiddleware;
use super::full_codec;
Expand All @@ -71,9 +72,9 @@ mod tests {
use ring::hmac::SigningKey;
use ring::hmac::VerificationKey;
use std::io::Error as IoError;
use tokio_core::net::TcpListener;
use tokio_core::net::TcpStream;
use tokio_core::reactor::Core;
use self::tokio_core::net::TcpListener;
use self::tokio_core::net::TcpStream;
use self::tokio_core::reactor::Core;
use tokio_io::codec::length_delimited::Framed;

#[test]
Expand Down
7 changes: 4 additions & 3 deletions libp2p-secio/src/handshake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@ fn stretch_key(key: &SigningKey, result: &mut [u8]) {

#[cfg(test)]
mod tests {
extern crate tokio_core;
use super::handshake;
use super::stretch_key;
use futures::Future;
Expand All @@ -451,9 +452,9 @@ mod tests {
use ring::hmac::SigningKey;
use ring::signature::RSAKeyPair;
use std::sync::Arc;
use tokio_core::net::TcpListener;
use tokio_core::net::TcpStream;
use tokio_core::reactor::Core;
use self::tokio_core::net::TcpListener;
use self::tokio_core::net::TcpStream;
use self::tokio_core::reactor::Core;
use untrusted::Input;

#[test]
Expand Down
1 change: 0 additions & 1 deletion libp2p-secio/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ extern crate protobuf;
extern crate rand;
extern crate ring;
extern crate rw_stream_sink;
extern crate tokio_core;
extern crate tokio_io;
extern crate untrusted;

Expand Down
1 change: 0 additions & 1 deletion libp2p-swarm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ multiaddr = "0.2.0"
multistream-select = { path = "../multistream-select" }
futures = "0.1"
smallvec = "0.5"
tokio-core = "0.1"
tokio-io = "0.1"

[dev-dependencies]
Expand Down
4 changes: 3 additions & 1 deletion multistream-select/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ authors = ["Parity Technologies <[email protected]>"]
bytes = "0.4"
futures = { version = "0.1" }
smallvec = "0.5"
tokio-core = "0.1"
tokio-io = "0.1"

[dev-dependencies]
tokio-core = "0.1"
1 change: 0 additions & 1 deletion multistream-select/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@
extern crate bytes;
extern crate futures;
extern crate smallvec;
extern crate tokio_core;
extern crate tokio_io;

mod dialer_select;
Expand Down
5 changes: 3 additions & 2 deletions multistream-select/src/protocol/dialer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,13 @@ impl<R> Stream for Dialer<R>

#[cfg(test)]
mod tests {
extern crate tokio_core;
use bytes::Bytes;
use futures::{Sink, Stream};
use futures::Future;
use protocol::{Dialer, DialerToListenerMessage, MultistreamSelectError};
use tokio_core::net::{TcpListener, TcpStream};
use tokio_core::reactor::Core;
use self::tokio_core::net::{TcpListener, TcpStream};
use self::tokio_core::reactor::Core;

#[test]
fn wrong_proto_name() {
Expand Down
5 changes: 3 additions & 2 deletions multistream-select/src/protocol/listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,13 @@ impl<R> Stream for Listener<R>

#[cfg(test)]
mod tests {
extern crate tokio_core;
use bytes::Bytes;
use futures::{Sink, Stream};
use futures::Future;
use protocol::{Dialer, Listener, ListenerToDialerMessage, MultistreamSelectError};
use tokio_core::net::{TcpListener, TcpStream};
use tokio_core::reactor::Core;
use self::tokio_core::net::{TcpListener, TcpStream};
use self::tokio_core::reactor::Core;

#[test]
fn wrong_proto_name() {
Expand Down
8 changes: 5 additions & 3 deletions multistream-select/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,18 @@
#![cfg(test)]

extern crate tokio_core;

use {listener_select_proto, dialer_select_proto};
use ProtocolChoiceError;
use bytes::Bytes;
use dialer_select::{dialer_select_proto_parallel, dialer_select_proto_serial};
use futures::{Sink, Stream};
use futures::Future;
use protocol::{Dialer, Listener, DialerToListenerMessage, ListenerToDialerMessage};
use tokio_core::net::TcpListener;
use tokio_core::net::TcpStream;
use tokio_core::reactor::Core;
use self::tokio_core::net::TcpListener;
use self::tokio_core::net::TcpStream;
use self::tokio_core::reactor::Core;

#[test]
fn negotiate_with_self_succeeds() {
Expand Down

0 comments on commit cd40755

Please sign in to comment.