Skip to content

Commit

Permalink
Avoid some warnings. (libp2p#733)
Browse files Browse the repository at this point in the history
- mdns: unused `Result` which must be used
- kad: unused import
- mplex: use of deprecated item
  • Loading branch information
twittner authored and tomaka committed Dec 5, 2018
1 parent b2367e5 commit 4140047
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion misc/mdns/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ mod tests {

match packet {
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) => {
for peer in response.discovered_peers() {
Expand Down
18 changes: 9 additions & 9 deletions muxers/mplex/tests/two_peers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ extern crate libp2p_mplex as multiplex;
extern crate libp2p_core as swarm;
extern crate libp2p_tcp_transport as tcp;
extern crate tokio;
extern crate tokio_io;

use futures::future::Future;
use futures::{Sink, Stream};
use futures::prelude::*;
use std::sync::{Arc, mpsc};
use std::thread;
use swarm::{muxing, Transport};
use tcp::TcpConfig;
use tokio_io::codec::length_delimited::Framed;
use tokio::runtime::current_thread::Runtime;
use tokio::{
codec::length_delimited::Builder,
runtime::current_thread::Runtime
};

#[test]
fn client_to_server_outbound() {
Expand All @@ -55,7 +55,7 @@ fn client_to_server_outbound() {
.map_err(|(err, _)| err)
.and_then(|(client, _)| client.unwrap().0)
.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| {
client
.into_future()
Expand All @@ -78,7 +78,7 @@ fn client_to_server_outbound() {
.dial(rx.recv().unwrap())
.unwrap()
.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()))
.map(|_| ());

Expand Down Expand Up @@ -107,7 +107,7 @@ fn client_to_server_inbound() {
.map_err(|(err, _)| err)
.and_then(|(client, _)| client.unwrap().0)
.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| {
client
.into_future()
Expand All @@ -130,7 +130,7 @@ fn client_to_server_inbound() {
.dial(rx.recv().unwrap())
.unwrap()
.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()))
.map(|_| ());

Expand Down
2 changes: 1 addition & 1 deletion protocols/kad/src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,7 @@ mod tests {
extern crate libp2p_tcp_transport;
extern crate tokio;

/*// TODO: restore
use self::libp2p_tcp_transport::TcpConfig;
use self::tokio::runtime::current_thread::Runtime;
use futures::{Future, Sink, Stream};
Expand All @@ -467,7 +468,6 @@ mod tests {
use std::sync::mpsc;
use std::thread;
/*// TODO: restore
#[test]
fn correct_transfer() {
// We open a server and a client, send a message between the two, and check that they were
Expand Down

0 comments on commit 4140047

Please sign in to comment.