Skip to content

Commit

Permalink
chore(network): compress open stream command handler
Browse files Browse the repository at this point in the history
  • Loading branch information
fbozic committed Jun 19, 2024
1 parent 4762c32 commit 5b81d2b
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions crates/network/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,14 +290,7 @@ impl EventLoop {
let _ = sender.send(Ok(topic));
}
Command::OpenStream { peer_id, sender } => {
match self.open_stream(peer_id).await {
Ok(stream) => {
let _ = sender.send(Ok(stream));
}
Err(err) => {
let _ = sender.send(Err(eyre::eyre!(err)));
}
};
let _ = sender.send(self.open_stream(peer_id).await.map_err(Into::into));
}
Command::PeerCount { sender } => {
let _ = sender.send(self.swarm.connected_peers().count());
Expand Down

0 comments on commit 5b81d2b

Please sign in to comment.