0

fix: `suspicious_else_formatting` false positive when else is included … by gran...

 1 month ago
source link: https://github.com/rust-lang/rust-clippy/pull/12549
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Conversation

Contributor

This PR addresses an issue where invalid suggestions are generated for if-else formatting if comments contain the keyword else.

The root of the problem is identified here. Specifically, when a comment contains the word else, the lint mistakenly interprets it as part of an if-else clause. This misinterpretation leads to an incorrect splitting of the snippet, resulting in erroneous suggestions.

fixes: #12497

changelog: [suspicious_else_formatting]: Fixes invalid suggestions when comments include word else


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK