-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
A-lintArea: New lintsArea: New lintsL-styleLint: Belongs in the style lint groupLint: Belongs in the style lint groupgood first issueThese issues are a good way to get started with ClippyThese issues are a good way to get started with Clippy
Description
When writing generic bounds such as:
fn foo<T>(a: T) where u32: From<T>;
Into
should be preferred, like this:
fn foo<T>(a: T) where T: Into<u32>;
Why the former is bad: Into
is a superset of From
. In some cases coherence rules prevent implementing From
but do allow implementing Into
. As a result Into
is more generic bound than From
.
Category: Style, I guess?
PurpleBooth
Metadata
Metadata
Assignees
Labels
A-lintArea: New lintsArea: New lintsL-styleLint: Belongs in the style lint groupLint: Belongs in the style lint groupgood first issueThese issues are a good way to get started with ClippyThese issues are a good way to get started with Clippy