mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-15 19:11:23 +00:00
*: Format with rustfmt (#2188)
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
This commit is contained in:
@ -40,13 +40,13 @@
|
||||
//! [`Swarm`]: libp2p_swarm::Swarm
|
||||
//! [`Transport`]: libp2p_core::Transport
|
||||
|
||||
pub mod protocol;
|
||||
pub mod handler;
|
||||
pub mod protocol;
|
||||
|
||||
pub use handler::{PingConfig, PingResult, PingSuccess, PingFailure};
|
||||
use handler::PingHandler;
|
||||
pub use handler::{PingConfig, PingFailure, PingResult, PingSuccess};
|
||||
|
||||
use libp2p_core::{PeerId, connection::ConnectionId};
|
||||
use libp2p_core::{connection::ConnectionId, PeerId};
|
||||
use libp2p_swarm::{NetworkBehaviour, NetworkBehaviourAction, PollParameters};
|
||||
use std::{collections::VecDeque, task::Context, task::Poll};
|
||||
use void::Void;
|
||||
@ -99,9 +99,11 @@ impl NetworkBehaviour for Ping {
|
||||
self.events.push_front(PingEvent { peer, result })
|
||||
}
|
||||
|
||||
fn poll(&mut self, _: &mut Context<'_>, _: &mut impl PollParameters)
|
||||
-> Poll<NetworkBehaviourAction<Void, PingEvent>>
|
||||
{
|
||||
fn poll(
|
||||
&mut self,
|
||||
_: &mut Context<'_>,
|
||||
_: &mut impl PollParameters,
|
||||
) -> Poll<NetworkBehaviourAction<Void, PingEvent>> {
|
||||
if let Some(e) = self.events.pop_back() {
|
||||
Poll::Ready(NetworkBehaviourAction::GenerateEvent(e))
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user