Skip to content

Commit

Permalink
Remove const_int_pow feature flag
Browse files Browse the repository at this point in the history
const_int_pow was stabilized in Rust 1.50.0
rust-lang/rust#76829
  • Loading branch information
Sergio Valverde committed Dec 14, 2020
1 parent 010c314 commit a2c3c00
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 11 deletions.
1 change: 0 additions & 1 deletion nano-sync/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![allow(dead_code)]
#![feature(const_int_pow)]

// Re-export big-endian serialization of algebra types.
pub use nimiq_bls::compression;
Expand Down
2 changes: 1 addition & 1 deletion network-albatross/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ impl NetworkInterface for Network {
unimplemented!()
}

async fn subscribe<T>(&self, _topic: &T) -> Box<dyn Stream<Item = (T::Item, Arc<Self::PeerType>)> + Send>
async fn subscribe<T>(&self, _topic: &T) -> Box<dyn Stream<Item = (T::Item, <Self::PeerType as PeerInterface>::Id)> + Send>
where
T: Topic + Sync,
{
Expand Down
2 changes: 1 addition & 1 deletion network-interface/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ pub trait Network: Send + Sync + 'static {
ReceiveFromAll::new(self)
}

async fn subscribe<T>(&self, topic: &T) -> Box<dyn Stream<Item = (T::Item, Arc<Self::PeerType>)> + Send>
async fn subscribe<T>(&self, topic: &T) -> Box<dyn Stream<Item = (T::Item, <Self::PeerType as Peer>::Id)> + Send>
where
T: Topic + Sync;

Expand Down
13 changes: 6 additions & 7 deletions network-libp2p/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,8 @@ impl Network {
GossipsubEvent::Message(peer_id, msg_id, msg) => {
log::trace!("Received message {:?} from peer {:?}: {:?}", msg_id, peer_id, msg);
for topic in msg.topics.iter() {
if let Some(output) = state.gossip_topics.get(&topic) {
// let peer = Self::get_peer(peer_id).unwrap();
output.send((msg, peer));
if let Some(output) = state.gossip_topics.get_mut(&topic) {
output.send((msg.clone(), peer_id.clone())).await.ok();
} else {
log::warn!("Unknown topic hash: {:?}", topic);
}
Expand Down Expand Up @@ -401,7 +400,7 @@ impl NetworkInterface for Network {
self.events_tx.subscribe()
}

async fn subscribe<T>(&self, topic: &T) -> Box<dyn Stream<Item = (T::Item, Arc<Self::PeerType>)> + Send>
async fn subscribe<T>(&self, topic: &T) -> Box<dyn Stream<Item = (T::Item, PeerId)> + Send>
where
T: Topic + Sync,
{
Expand All @@ -417,9 +416,9 @@ impl NetworkInterface for Network {
.await
.expect("Couldn't subscribe to pubsub topic");

Box::new(rx.map(|(msg, peer)| {
let item: <T as Topic>::Item = Deserialize::deserialize_from_vec(&msg.data);
(item, peer)
Box::new(rx.map(|(msg, peer_id)| {
let item: <T as Topic>::Item = Deserialize::deserialize_from_vec(&msg.data).unwrap();
(item, peer_id)
}))
}

Expand Down
2 changes: 1 addition & 1 deletion network-mock/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ impl Network for MockNetwork {
self.event_tx.subscribe()
}

async fn subscribe<T>(&self, _topic: &T) -> Box<dyn Stream<Item = (T::Item, Arc<Self::PeerType>)> + Send>
async fn subscribe<T>(&self, _topic: &T) -> Box<dyn Stream<Item = (T::Item, usize)> + Send>
where
T: Topic + Sync,
{
Expand Down

0 comments on commit a2c3c00

Please sign in to comment.