Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Fix too long lines.
Browse files Browse the repository at this point in the history
  • Loading branch information
eskimor committed Feb 2, 2021
1 parent 8869176 commit 044bff8
Showing 1 changed file with 29 additions and 20 deletions.
49 changes: 29 additions & 20 deletions client/network/src/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,24 +450,33 @@ impl<B: BlockT, H: ExHashT> NetworkBehaviourEventProcess<DiscoveryOut>
}

impl<B: BlockT, H: ExHashT> Behaviour<B, H> {
fn poll<TEv>(
&mut self,
cx: &mut Context,
_: &mut impl PollParameters,
) -> Poll<NetworkBehaviourAction<TEv, BehaviourOut<B>>> {
use light_client_requests::sender::OutEvent;
while let Poll::Ready(Some(event)) = self.light_client_request_sender.poll_next_unpin(cx) {
match event {
OutEvent::SendRequest { target, request, pending_response, protocol_name } => {
self.request_responses.send_request(&target, &protocol_name, request, pending_response, IfDisconnected::ImmediateError)
}
}
}

if let Some(event) = self.events.pop_front() {
return Poll::Ready(NetworkBehaviourAction::GenerateEvent(event))
}

Poll::Pending
}
fn poll<TEv>(
&mut self,
cx: &mut Context,
_: &mut impl PollParameters,
) -> Poll<NetworkBehaviourAction<TEv, BehaviourOut<B>>> {
use light_client_requests::sender::OutEvent;
while let Poll::Ready(Some(event)) = self.light_client_request_sender.poll_next_unpin(cx) {
match event {
OutEvent::SendRequest {
target,
request,
pending_response,
protocol_name,
} => self.request_responses.send_request(
&target,
&protocol_name,
request,
pending_response,
IfDisconnected::ImmediateError,
),
}
}

if let Some(event) = self.events.pop_front() {
return Poll::Ready(NetworkBehaviourAction::GenerateEvent(event));
}

Poll::Pending
}
}

0 comments on commit 044bff8

Please sign in to comment.