False positive explicit_counter_loop when the counter is used in a closure after the loop #4732
Labels
C-bug
Category: Clippy is not doing the correct thing
C-enhancement
Category: Enhancement of lints, like adding more cases or adding help messages
good-first-issue
These issues are a good way to get started with Clippy
The
explicit_counter_loop
lint is incorrectly triggered in this case:This is incorrect because the counter is used after the loop. Note that if the counter were used directly and not in a closure, the lint would not get triggered.
Rust playground: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=3f1f1216aa7a4344d6891fc9e4ccdd5c
The text was updated successfully, but these errors were encountered: