Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

&mut self -> &mut Self #1073

Merged
merged 2 commits into from
Apr 23, 2019
Merged

&mut self -> &mut Self #1073

merged 2 commits into from
Apr 23, 2019

Conversation

tomaka
Copy link
Member

@tomaka tomaka commented Apr 19, 2019

cc #1065

@ghost ghost assigned tomaka Apr 19, 2019
@ghost ghost added the in progress label Apr 19, 2019
Copy link
Contributor

@romanb romanb left a comment

Choose a reason for hiding this comment

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

I'm just curious: What motivates basing the Swarm API on associated functions in this way?

@tomaka
Copy link
Member Author

tomaka commented Apr 22, 2019

What motivates basing the Swarm API on associated functions in this way?

Swarm has a Derefs to the NetworkBehaviour, and it is bad form to have at the same time regular methods and a deref (see Arc for example).

Normally the Swarm's inherent methods aren't supposed to be called (eg. you're not supposed to dial, as the network behaviour does that already; initially it was the same for listening), which is why I did that.

This is of course a debatable decision, but for now I think it's more important to be consistent.

@tomaka tomaka mentioned this pull request Apr 23, 2019
@tomaka tomaka merged commit 5c34f8a into libp2p:master Apr 23, 2019
@tomaka tomaka deleted the refine-1065 branch April 23, 2019 08:54
@ghost ghost removed the in progress label Apr 23, 2019
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.

2 participants