Skip to content

Commit e187c80

Browse files
author
Sergio Valverde
committed
Remove const_int_pow feature flag
const_int_pow was stabilized in Rust 1.50.0 rust-lang/rust#76829
1 parent 653ff87 commit e187c80

File tree

5 files changed

+9
-11
lines changed

5 files changed

+9
-11
lines changed

nano-sync/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![allow(dead_code)]
2-
#![feature(const_int_pow)]
32

43
// Re-export big-endian serialization of algebra types.
54
pub use nimiq_bls::compression;

network-albatross/src/network.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ impl NetworkInterface for Network {
429429
unimplemented!()
430430
}
431431

432-
async fn subscribe<T>(&self, _topic: &T) -> Box<dyn Stream<Item = (T::Item, Arc<Self::PeerType>)> + Send>
432+
async fn subscribe<T>(&self, _topic: &T) -> Box<dyn Stream<Item = (T::Item, <Self::PeerType as PeerInterface>::Id)> + Send>
433433
where
434434
T: Topic + Sync,
435435
{

network-interface/src/network.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ pub trait Network: Send + Sync + 'static {
7171
ReceiveFromAll::new(self)
7272
}
7373

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

network-libp2p/src/network.rs

+6-7
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,8 @@ impl Network {
299299
GossipsubEvent::Message(peer_id, msg_id, msg) => {
300300
log::trace!("Received message {:?} from peer {:?}: {:?}", msg_id, peer_id, msg);
301301
for topic in msg.topics.iter() {
302-
if let Some(output) = state.gossip_topics.get(&topic) {
303-
// let peer = Self::get_peer(peer_id).unwrap();
304-
output.send((msg, peer));
302+
if let Some(output) = state.gossip_topics.get_mut(&topic) {
303+
output.send((msg.clone(), peer_id.clone())).await.ok();
305304
} else {
306305
log::warn!("Unknown topic hash: {:?}", topic);
307306
}
@@ -398,7 +397,7 @@ impl NetworkInterface for Network {
398397
self.events_tx.subscribe()
399398
}
400399

401-
async fn subscribe<T>(&self, topic: &T) -> Box<dyn Stream<Item = (T::Item, Arc<Self::PeerType>)> + Send>
400+
async fn subscribe<T>(&self, topic: &T) -> Box<dyn Stream<Item = (T::Item, PeerId)> + Send>
402401
where
403402
T: Topic + Sync,
404403
{
@@ -414,9 +413,9 @@ impl NetworkInterface for Network {
414413
.await
415414
.expect("Couldn't subscribe to pubsub topic");
416415

417-
Box::new(rx.map(|(msg, peer)| {
418-
let item: <T as Topic>::Item = Deserialize::deserialize_from_vec(&msg.data);
419-
(item, peer)
416+
Box::new(rx.map(|(msg, peer_id)| {
417+
let item: <T as Topic>::Item = Deserialize::deserialize_from_vec(&msg.data).unwrap();
418+
(item, peer_id)
420419
}))
421420
}
422421

network-mock/src/network.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ impl Network for MockNetwork {
236236
self.event_tx.subscribe()
237237
}
238238

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

0 commit comments

Comments
 (0)