You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it would be beneficial to have other lints as well ([try_][r]fold, size_hint mainly) so this is only the first one.
A single LateLintPass would be needed for all of them.
After discussion on zulip and some reflexion, those lints (if wanted) should at least be part of the same lint pass as missing_trait_methods. Alternatively, missing_trait_methods could be configurable in clippy.toml. Have multiple lints would be more flexible but I understand the reluctance expressed.
EDIT: I will soon make a PR to make missing_trait_methods configurable.
What it does
Lints implementations of
core::iter::Iterator
that do not specialize thefold
method.Advantage
for_each
,count
, ...) rely onfold
by default and would benefit fromfold
being specialized.fold
(or related methods) for their own usage and would benefit as well.Drawbacks
Specialize it may not be faster than the default behavior.
Example
Could be written as:
The text was updated successfully, but these errors were encountered: