RS.CLIPPY.FROM_OVER_INTO
Warns on implementations of `Into<..>` to use `From<..>`
This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: from_over_into. Copyright ©2025 The Rust Team. All rights reserved.
What it does
Searches for implementations of the Into<..> trait and suggests to implement From<..> instead.
Why is this bad?
According the std docs implementing From<..> is preferred since it gives you Into<..> for free where the reverse isn't true.
Example
struct StringWrapper(String);
impl Into<StringWrapper> for String {
fn into(self) -> StringWrapper {
StringWrapper(self)
}
}
Use instead:
struct StringWrapper(String);
impl From<String> for StringWrapper {
fn from(s: String) -> StringWrapper {
StringWrapper(s)
}
}
Configuration
-
msrv: The minimum rust version that the project supports. Defaults to therust-versionfield inCargo.toml(default:
current version)