Skip to content

Commit

Permalink
rustfmt for clique/src/protocols/v1/mod.rs and finality-aleph/src/net…
Browse files Browse the repository at this point in the history
…work/flooding.rs
  • Loading branch information
fixxxedpoint committed Nov 27, 2024
1 parent d934553 commit f8a8312
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
3 changes: 2 additions & 1 deletion clique/src/protocols/v1/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,11 @@ async fn sending<PK: PublicKey, D: Data, S: AsyncWrite + Unpin + Send>(
mut sender: S,
mut data_from_user: mpsc::UnboundedReceiver<D>,
) -> Result<(), ProtocolError<PK>> {
use crate::io::send_data;
use futures::StreamExt;
use Message::*;

use crate::io::send_data;

loop {
let to_send = match timeout(HEARTBEAT_TIMEOUT, data_from_user.next()).await {
Ok(maybe_data) => match maybe_data {
Expand Down
11 changes: 3 additions & 8 deletions finality-aleph/src/network/flooding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ use futures::{channel::mpsc, Future, SinkExt, StreamExt};
use log::{debug, error, info, warn};
use lru::LruCache;
use network_clique::SpawnHandleT;
use sc_network::MessageSink;
use sc_network::PeerId;
use sc_network::{MessageSink, PeerId};

use crate::{
network::{Data, GossipNetwork},
Expand All @@ -30,9 +29,7 @@ impl FloodingProtocolNetwork {
protocol_network: ProtocolNetwork,
mut peer_filter: impl FnMut(&PeerId) -> bool + Send + 'static,
) -> (
FloodingProtocolNetwork<
impl FnMut(Vec<u8>, PeerId, &mut ProtocolNetwork) + Send + 'static,
>,
FloodingProtocolNetwork<impl FnMut(Vec<u8>, PeerId, &mut ProtocolNetwork) + Send + 'static>,
mpsc::Receiver<(Vec<u8>, PeerId, Arc<Box<dyn MessageSink>>)>,
) {
let (mut flooder_sender, flooder_receiver) = mpsc::channel(0);
Expand Down Expand Up @@ -71,9 +68,7 @@ impl FloodingProtocolNetwork {
peer_filter: impl FnMut(&PeerId) -> bool + Send + 'static,
spawn_handle: SH,
) -> (
FloodingProtocolNetwork<
impl FnMut(Vec<u8>, PeerId, &mut ProtocolNetwork) + Send + 'static,
>,
FloodingProtocolNetwork<impl FnMut(Vec<u8>, PeerId, &mut ProtocolNetwork) + Send + 'static>,
impl Future<Output = Result<(), &'static str>> + Send,
)
where
Expand Down

0 comments on commit f8a8312

Please sign in to comment.