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

Prefer Into over From in trait bounds. #1460

Open
cheako opened this issue Nov 9, 2021 · 0 comments
Open

Prefer Into over From in trait bounds. #1460

cheako opened this issue Nov 9, 2021 · 0 comments
Milestone

Comments

@cheako
Copy link

cheako commented Nov 9, 2021

https://github.com/Geal/nom/blob/ac34e5ac110c82d3ae7e28149a180fb9298b8089/src/internal.rs#L98

From the docs Prefer using Into over using From when specifying trait bounds on a generic function. This way, types that directly implement Into can be used as arguments as well.

@Geal Geal added this to the 8.0 milestone Mar 14, 2022
epage added a commit to epage/winnow that referenced this issue Feb 1, 2023
Unsure how to handle `O: From<u8>` type bounds.

Inspired by rust-bakery/nom#1460
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

No branches or pull requests

2 participants