Misleading code example for wrong_pub_self_convention
lint
#6438
Labels
A-documentation
Area: Adding or improving documentation
A-lint
Area: New lints
C-enhancement
Category: Enhancement of lints, like adding more cases or adding help messages
The
wrong_pub_self_convention
example from documentation is kind of misleading to me.The example for this lint is:
On playground, it fires
wrong_self_convention
(insteadwrong_pub_self_convention
), so the example or the lint needs to be reworked.The difference with
wrong_self_convention
example is mainly thepub
keyword on the methodas_str
, but the lint doesn't use the function visibility as condition to choose which lint to fire (in fact it uses the visibility of the impl item).As proposed in #6316, it would probably make sense to also look into the history of the lints, what were the reasons to split them (if that was the case)?
It seems there are no tests for the pub variant.
The text was updated successfully, but these errors were encountered: