-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Closed
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.I-needs-decisionIssue: In need of a decision.Issue: In need of a decision.
Description
We currently have a convention that unused variables that start with _ do not cause the unused variable lint to fire.
Should we put in a similar rule for the non_snake_case lint? (Perhaps just for variables with two leading underscores, __, ?)
In my particular case, I am using things like format!("foo {N}", N=name), and the expanded code causes the non-snake-case lint to fire, because it generates names like __argN ...
I could add an #[allow] annotation to the code in question, but this seems unfortunate to me. (Am I the only one who finds format strings easier to read if I use short capital letters for the named substitutions?)
jonathanbuchanan and UFOXD
Metadata
Metadata
Assignees
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.I-needs-decisionIssue: In need of a decision.Issue: In need of a decision.