Fix deprecated futures items (#148)

* Update futures deprecated send item
* Update futures deprecated iter item
* Fix cargo req for futures
This commit is contained in:
Seamus Finnigan 2017-10-01 21:34:14 +00:00 committed by Ignotus Peverell
parent a1f99fbec6
commit 2e819c72aa
5 changed files with 10 additions and 10 deletions

View file

@ -17,7 +17,7 @@ grin_pow = { path = "../pow" }
secp256k1zkp = { git = "https://github.com/mimblewimble/rust-secp256k1-zkp" } secp256k1zkp = { git = "https://github.com/mimblewimble/rust-secp256k1-zkp" }
env_logger="^0.3.5" env_logger="^0.3.5"
futures = "^0.1.9" futures = "^0.1.15"
futures-cpupool = "^0.1.3" futures-cpupool = "^0.1.3"
hyper = { git = "https://github.com/hyperium/hyper" } hyper = { git = "https://github.com/hyperium/hyper" }
log = "^0.3" log = "^0.3"

View file

@ -118,7 +118,7 @@ impl Seeder {
thread_rng().shuffle(&mut peers[..]); thread_rng().shuffle(&mut peers[..]);
let sz = min(PEER_PREFERRED_COUNT as usize, peers.len()); let sz = min(PEER_PREFERRED_COUNT as usize, peers.len());
for p in &peers[0..sz] { for p in &peers[0..sz] {
tx.send(p.addr).unwrap(); tx.unbounded_send(p.addr).unwrap();
} }
} }
} }
@ -165,7 +165,7 @@ impl Seeder {
let sz = min(PEER_PREFERRED_COUNT as usize, peer_addrs.len()); let sz = min(PEER_PREFERRED_COUNT as usize, peer_addrs.len());
for addr in &peer_addrs[0..sz] { for addr in &peer_addrs[0..sz] {
debug!("Connecting to seed: {}.", addr); debug!("Connecting to seed: {}.", addr);
tx.send(*addr).unwrap(); tx.unbounded_send(*addr).unwrap();
} }
if peer_addrs.len() == 0 { if peer_addrs.len() == 0 {
warn!("No seeds were retrieved."); warn!("No seeds were retrieved.");

View file

@ -7,7 +7,7 @@ workspace = ".."
[dependencies] [dependencies]
bitflags = "^0.7.0" bitflags = "^0.7.0"
byteorder = "^0.5" byteorder = "^0.5"
futures = "^0.1.9" futures = "^0.1.15"
log = "^0.3" log = "^0.3"
net2 = "0.2.0" net2 = "0.2.0"
rand = "^0.3" rand = "^0.3"

View file

@ -183,7 +183,7 @@ impl Connection {
// infinite iterator stream so we repeat the message reading logic until the // infinite iterator stream so we repeat the message reading logic until the
// peer is stopped // peer is stopped
let iter = stream::iter(iter::repeat(()).map(Ok::<(), Error>)); let iter = stream::iter_ok(iter::repeat(()).map(Ok::<(), Error>));
// setup the reading future, getting messages from the peer and processing them // setup the reading future, getting messages from the peer and processing them
let recv_bytes = self.received_bytes.clone(); let recv_bytes = self.received_bytes.clone();
@ -238,7 +238,7 @@ impl Connection {
)); ));
data.append(&mut body_data); data.append(&mut body_data);
self.outbound_chan.send(data).map_err( self.outbound_chan.unbounded_send(data).map_err(
|_| Error::ConnectionClose, |_| Error::ConnectionClose,
) )
} }

View file

@ -134,7 +134,7 @@ fn handle_payload(
match header.msg_type { match header.msg_type {
Type::Ping => { Type::Ping => {
let data = ser::ser_vec(&MsgHeader::new(Type::Pong, 0))?; let data = ser::ser_vec(&MsgHeader::new(Type::Pong, 0))?;
sender.send(data).unwrap(); sender.unbounded_send(data).unwrap();
Ok(None) Ok(None)
} }
Type::Pong => Ok(None), Type::Pong => Ok(None),
@ -156,7 +156,7 @@ fn handle_payload(
&MsgHeader::new(Type::Block, body_data.len() as u64), &MsgHeader::new(Type::Block, body_data.len() as u64),
)); ));
data.append(&mut body_data); data.append(&mut body_data);
sender.send(data).unwrap(); sender.unbounded_send(data).unwrap();
} }
Ok(None) Ok(None)
} }
@ -183,7 +183,7 @@ fn handle_payload(
&MsgHeader::new(Type::Headers, body_data.len() as u64), &MsgHeader::new(Type::Headers, body_data.len() as u64),
)); ));
data.append(&mut body_data); data.append(&mut body_data);
sender.send(data).unwrap(); sender.unbounded_send(data).unwrap();
Ok(None) Ok(None)
} }
@ -210,7 +210,7 @@ fn handle_payload(
&MsgHeader::new(Type::PeerAddrs, body_data.len() as u64), &MsgHeader::new(Type::PeerAddrs, body_data.len() as u64),
)); ));
data.append(&mut body_data); data.append(&mut body_data);
sender.send(data).unwrap(); sender.unbounded_send(data).unwrap();
Ok(None) Ok(None)
} }