mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-27 00:31:35 +00:00
multistream-select: Less allocations. (#800)
This commit is contained in:
@ -224,6 +224,7 @@ type NameWrapIter<I> =
|
||||
std::iter::Map<I, fn(<I as Iterator>::Item) -> NameWrap<<I as Iterator>::Item>>;
|
||||
|
||||
/// Wrapper type to expose an `AsRef<[u8]>` impl for all types implementing `ProtocolName`.
|
||||
#[derive(Clone)]
|
||||
struct NameWrap<N>(N);
|
||||
|
||||
impl<N: ProtocolName> AsRef<[u8]> for NameWrap<N> {
|
||||
|
@ -91,7 +91,7 @@ impl<T: AsRef<[u8]>> ProtocolName for T {
|
||||
/// or both.
|
||||
pub trait UpgradeInfo {
|
||||
/// Opaque type representing a negotiable protocol.
|
||||
type Info: ProtocolName;
|
||||
type Info: ProtocolName + Clone;
|
||||
/// Iterator returned by `protocol_info`.
|
||||
type InfoIter: IntoIterator<Item = Self::Info>;
|
||||
|
||||
|
Reference in New Issue
Block a user