Skip to content

Commit

Permalink
Set the MSRV compatibility to 1.74.1
Browse files Browse the repository at this point in the history
  • Loading branch information
alfred-hodler committed Jun 3, 2024
1 parent 880ccb8 commit 008133e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 5 additions & 3 deletions pushtx/src/p2p.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ pub trait Outbox<P: Peerlike> {
}

/// Describes a type capable of receiving p2p events.
pub trait Receiver<P: Peerlike> {
fn receiver(&self) -> &crossbeam_channel::Receiver<impl Into<Event<P>>>;
pub trait Receiver<P: Peerlike, T: Into<Event<P>>> {
fn receiver(&self) -> &crossbeam_channel::Receiver<T>;
}

/// Describes a type that sends queued commands outbound.
Expand Down Expand Up @@ -113,6 +113,8 @@ pub fn client(
socks_proxy: Option<SocketAddr>,
network: crate::Network,
ua: Option<(String, u64, u64)>,
) -> impl Sender + Receiver<peerlink::PeerId> + Outbox<peerlink::PeerId> {
) -> impl Sender
+ Receiver<peerlink::PeerId, peerlink::Event<protocol::Message, net::Service>>
+ Outbox<peerlink::PeerId> {
client::client(socks_proxy, network, ua)
}
6 changes: 4 additions & 2 deletions pushtx/src/p2p/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,10 @@ impl super::Sender for Client {
}
}

impl super::Receiver<PeerId> for Client {
fn receiver(&self) -> &crossbeam_channel::Receiver<impl Into<super::Event<PeerId>>> {
impl super::Receiver<PeerId, peerlink::Event<protocol::Message, net::Service>> for Client {
fn receiver(
&self,
) -> &crossbeam_channel::Receiver<peerlink::Event<protocol::Message, net::Service>> {
self.peerlink.receiver()
}
}
Expand Down

0 comments on commit 008133e

Please sign in to comment.