JErnestoMtz / rapl

Rank Polymorphic array library for Rust.
103 stars 3 forks source link

Into and From traits in natives.rs #2

Closed S-Erik closed 1 year ago

S-Erik commented 1 year ago

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 commented 1 year ago

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