mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-28 09:11:34 +00:00
Avoid some warnings. (#733)
- mdns: unused `Result` which must be used - kad: unused import - mplex: use of deprecated item
This commit is contained in:
committed by
Pierre Krieger
parent
b2367e59ce
commit
4140047f34
@ -569,7 +569,7 @@ mod tests {
|
|||||||
|
|
||||||
match packet {
|
match packet {
|
||||||
MdnsPacket::Query(query) => {
|
MdnsPacket::Query(query) => {
|
||||||
query.respond(peer_id.clone(), None, Duration::from_secs(120));
|
query.respond(peer_id.clone(), None, Duration::from_secs(120)).unwrap();
|
||||||
}
|
}
|
||||||
MdnsPacket::Response(response) => {
|
MdnsPacket::Response(response) => {
|
||||||
for peer in response.discovered_peers() {
|
for peer in response.discovered_peers() {
|
||||||
|
@ -24,16 +24,16 @@ extern crate libp2p_mplex as multiplex;
|
|||||||
extern crate libp2p_core as swarm;
|
extern crate libp2p_core as swarm;
|
||||||
extern crate libp2p_tcp_transport as tcp;
|
extern crate libp2p_tcp_transport as tcp;
|
||||||
extern crate tokio;
|
extern crate tokio;
|
||||||
extern crate tokio_io;
|
|
||||||
|
|
||||||
use futures::future::Future;
|
use futures::prelude::*;
|
||||||
use futures::{Sink, Stream};
|
|
||||||
use std::sync::{Arc, mpsc};
|
use std::sync::{Arc, mpsc};
|
||||||
use std::thread;
|
use std::thread;
|
||||||
use swarm::{muxing, Transport};
|
use swarm::{muxing, Transport};
|
||||||
use tcp::TcpConfig;
|
use tcp::TcpConfig;
|
||||||
use tokio_io::codec::length_delimited::Framed;
|
use tokio::{
|
||||||
use tokio::runtime::current_thread::Runtime;
|
codec::length_delimited::Builder,
|
||||||
|
runtime::current_thread::Runtime
|
||||||
|
};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn client_to_server_outbound() {
|
fn client_to_server_outbound() {
|
||||||
@ -55,7 +55,7 @@ fn client_to_server_outbound() {
|
|||||||
.map_err(|(err, _)| err)
|
.map_err(|(err, _)| err)
|
||||||
.and_then(|(client, _)| client.unwrap().0)
|
.and_then(|(client, _)| client.unwrap().0)
|
||||||
.and_then(|client| muxing::outbound_from_ref_and_wrap(Arc::new(client)))
|
.and_then(|client| muxing::outbound_from_ref_and_wrap(Arc::new(client)))
|
||||||
.map(|client| Framed::<_, bytes::BytesMut>::new(client.unwrap()))
|
.map(|client| Builder::new().new_read(client.unwrap()))
|
||||||
.and_then(|client| {
|
.and_then(|client| {
|
||||||
client
|
client
|
||||||
.into_future()
|
.into_future()
|
||||||
@ -78,7 +78,7 @@ fn client_to_server_outbound() {
|
|||||||
.dial(rx.recv().unwrap())
|
.dial(rx.recv().unwrap())
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.and_then(|client| muxing::inbound_from_ref_and_wrap(Arc::new(client)))
|
.and_then(|client| muxing::inbound_from_ref_and_wrap(Arc::new(client)))
|
||||||
.map(|server| Framed::<_, bytes::BytesMut>::new(server.unwrap()))
|
.map(|server| Builder::new().new_write(server.unwrap()))
|
||||||
.and_then(|server| server.send("hello world".into()))
|
.and_then(|server| server.send("hello world".into()))
|
||||||
.map(|_| ());
|
.map(|_| ());
|
||||||
|
|
||||||
@ -107,7 +107,7 @@ fn client_to_server_inbound() {
|
|||||||
.map_err(|(err, _)| err)
|
.map_err(|(err, _)| err)
|
||||||
.and_then(|(client, _)| client.unwrap().0)
|
.and_then(|(client, _)| client.unwrap().0)
|
||||||
.and_then(|client| muxing::inbound_from_ref_and_wrap(Arc::new(client)))
|
.and_then(|client| muxing::inbound_from_ref_and_wrap(Arc::new(client)))
|
||||||
.map(|client| Framed::<_, bytes::BytesMut>::new(client.unwrap()))
|
.map(|client| Builder::new().new_read(client.unwrap()))
|
||||||
.and_then(|client| {
|
.and_then(|client| {
|
||||||
client
|
client
|
||||||
.into_future()
|
.into_future()
|
||||||
@ -130,7 +130,7 @@ fn client_to_server_inbound() {
|
|||||||
.dial(rx.recv().unwrap())
|
.dial(rx.recv().unwrap())
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.and_then(|client| muxing::outbound_from_ref_and_wrap(Arc::new(client)))
|
.and_then(|client| muxing::outbound_from_ref_and_wrap(Arc::new(client)))
|
||||||
.map(|server| Framed::<_, bytes::BytesMut>::new(server.unwrap()))
|
.map(|server| Builder::new().new_write(server.unwrap()))
|
||||||
.and_then(|server| server.send("hello world".into()))
|
.and_then(|server| server.send("hello world".into()))
|
||||||
.map(|_| ());
|
.map(|_| ());
|
||||||
|
|
||||||
|
@ -458,6 +458,7 @@ mod tests {
|
|||||||
extern crate libp2p_tcp_transport;
|
extern crate libp2p_tcp_transport;
|
||||||
extern crate tokio;
|
extern crate tokio;
|
||||||
|
|
||||||
|
/*// TODO: restore
|
||||||
use self::libp2p_tcp_transport::TcpConfig;
|
use self::libp2p_tcp_transport::TcpConfig;
|
||||||
use self::tokio::runtime::current_thread::Runtime;
|
use self::tokio::runtime::current_thread::Runtime;
|
||||||
use futures::{Future, Sink, Stream};
|
use futures::{Future, Sink, Stream};
|
||||||
@ -467,7 +468,6 @@ mod tests {
|
|||||||
use std::sync::mpsc;
|
use std::sync::mpsc;
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
|
||||||
/*// TODO: restore
|
|
||||||
#[test]
|
#[test]
|
||||||
fn correct_transfer() {
|
fn correct_transfer() {
|
||||||
// We open a server and a client, send a message between the two, and check that they were
|
// We open a server and a client, send a message between the two, and check that they were
|
||||||
|
Reference in New Issue
Block a user