New lint: Suggest using Self::Variant
instead of TheType::Variant
#4296
Labels
C-enhancement
Category: Enhancement of lints, like adding more cases or adding help messages
Uh oh!
There was an error while loading. Please reload this page.
Since Rust 1.37.0 (hits stable on August 15th 2019) it is possible to use
Self::
inside implementations to refer to variants of theSelf
type. This was stabilized in rust-lang/rust#61682 (see it for tests).Similar to the suggestion to match and construct via
Self(...)
orSelf { ... }
it would be likewise good to suggest matching and constructing throughSelf::Variant
where applicable. This seems consistent with Clippy's sensibilities... :)The text was updated successfully, but these errors were encountered: