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

Remove unneded Box::pin from discovery() #49

Merged
merged 1 commit into from
Jul 20, 2020

Conversation

DmitrySamoylov
Copy link
Contributor

Pin introduced some compilation problems when running in tokio::task.

discovery() signature slightly changed but usage remains the same.

Pin introduced some compilation problems when 
running in `tokio::task`. 

`discovery()` signature slightly changed but usage remains the same.
Copy link
Contributor

@jplatte jplatte left a comment

Choose a reason for hiding this comment

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

Not sure what this logic is used for, but AFAICT the old and new code do the same.

Only thing that I find a bit weird is that check_addr has a String parameter rather than &str (does it really need ownership)? That's orthogonal to the change you did though.

@DmitrySamoylov
Copy link
Contributor Author

The logic should be the same. I had compilation errors when discovery() is used in tokio::spawn() like here. Without Pins works fine.

Could not make check_addr work with &str because future needs ownership over this string from what I can tell.

@jplatte
Copy link
Contributor

jplatte commented Jul 17, 2020

Yeah, I just played around with it and it's not easy at all. I think in theory it is possible for the future to borrow the string, but there's no way yet to write the required bounds in a way that Rust understands and accepts them 😄

@DmitrySamoylov DmitrySamoylov merged commit 8cfa504 into master Jul 20, 2020
@DmitrySamoylov DmitrySamoylov deleted the remove-pin-from-discovery branch July 20, 2020 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants