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

Into and From traits in natives.rs #2

Closed
S-Erik opened this issue Mar 23, 2023 · 1 comment
Closed

Into and From traits in natives.rs #2

S-Erik opened this issue Mar 23, 2023 · 1 comment

Comments

@S-Erik
Copy link
Contributor

S-Erik commented Mar 23, 2023

In the file src/natives.rs the Into trait is implemented for arrays, Vec, Range and string slices.

Clippy suggests that one should always prefer to implement the From trait

because implementing From automatically provides one with an implementation of Into thanks to the blanket implementation in the standard library.

This is also discussed in this Issue in the Clippy Github.

Therefore, I suggest implementing the Into trait instead of the From trait in natives.rs.

A pull request implementing the From trait instead of the Into trait can be found here: #3

@JErnestoMtz
Copy link
Owner

Thanks a lot!! I wasn't aware that From was preferred, its good to know.

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