From bcc6721257889f85f57af1b40351540585ffd41d Mon Sep 17 00:00:00 2001 From: hozan23 Date: Thu, 27 Jun 2024 03:52:18 +0200 Subject: Remove redundant type aliases --- p2p/src/protocol.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'p2p/src/protocol.rs') diff --git a/p2p/src/protocol.rs b/p2p/src/protocol.rs index d42f092..021844f 100644 --- a/p2p/src/protocol.rs +++ b/p2p/src/protocol.rs @@ -4,11 +4,9 @@ use async_trait::async_trait; use karyon_core::event::EventValue; -use crate::{peer::ArcPeer, version::Version, Result}; +use crate::{peer::Peer, version::Version, Result}; -pub type ArcProtocol = Arc; - -pub type ProtocolConstructor = dyn Fn(ArcPeer) -> Arc + Send + Sync; +pub type ProtocolConstructor = dyn Fn(Arc) -> Arc + Send + Sync; pub type ProtocolID = String; @@ -38,17 +36,17 @@ impl EventValue for ProtocolEvent { /// use smol::Executor; /// /// use karyon_p2p::{ -/// protocol::{ArcProtocol, Protocol, ProtocolID, ProtocolEvent}, -/// Backend, PeerID, Config, Version, Error, ArcPeer, +/// protocol::{Protocol, ProtocolID, ProtocolEvent}, +/// Backend, PeerID, Config, Version, Error, Peer, /// keypair::{KeyPair, KeyPairType}, /// }; /// /// pub struct NewProtocol { -/// peer: ArcPeer, +/// peer: Arc, /// } /// /// impl NewProtocol { -/// fn new(peer: ArcPeer) -> ArcProtocol { +/// fn new(peer: Arc) -> Arc { /// Arc::new(Self { /// peer, /// }) -- cgit v1.2.3