Skip to content

misc/multistream-select: Cleanup trait bounds and remove unused file#2067

Merged
mxinden merged 3 commits into
libp2p:masterfrom
mxinden:cleanup-multistream
May 17, 2021
Merged

misc/multistream-select: Cleanup trait bounds and remove unused file#2067
mxinden merged 3 commits into
libp2p:masterfrom
mxinden:cleanup-multistream

Conversation

@mxinden

@mxinden mxinden commented May 6, 2021

Copy link
Copy Markdown
Member

Small cleanups found while implementing #2066 namely:

  • Remove unused file error.rs.
  • Remove unnecessary trait bounds on structs.

I: Iterator,
I::Item: AsRef<[u8]>
{
pub struct DialerSelectSeq<R, I: Iterator> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did a quick exploration whether we could get rid of this trait-bound as well but I don't think it is worth it. Not if we want to keep exporting a named type from multistream-select and I believe switching to impl Trait for dialer_select_proto makes the situation in rust-libp2p actually worse because we'd have more type parameters bubbling up (or would need to start boxing things once we are in libp2p-swarm).

@mxinden

mxinden commented May 12, 2021

Copy link
Copy Markdown
Member Author

@vmx do you have a couple of minutes to give this pull request a review?

@mxinden mxinden merged commit d9f1c71 into libp2p:master May 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants