-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesCategory: Enhancement of lints, like adding more cases or adding help messagesL-suggestionLint: Improving, adding or fixing lint suggestionsLint: Improving, adding or fixing lint suggestions
Description
Adding Clippy to libsyntax2, the suggestion for the collapsible_if
lint has incorrect indentation.
See https://travis-ci.org/matklad/libsyntax2/jobs/409527826#L508-L523
The suggestion is:
warning: this if statement can be collapsed
--> src/parser/grammar/items/mod.rs:277:5
|
277 | / if !p.eat(SEMI) {
278 | | if p.expect(L_CURLY) {
279 | | mod_contents(p, true);
280 | | p.expect(R_CURLY);
281 | | }
282 | | }
| |_____^
|
= note: #[warn(collapsible_if)] on by default
= help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/v0.0.212/index.html#collapsible_if
help: try
|
277 | if !p.eat(SEMI) && p.expect(L_CURLY) {
278 | mod_contents(p, true);
279 | p.expect(R_CURLY);
280 | }
|
It should be:
277 | if !p.eat(SEMI) && p.expect(L_CURLY) {
278 | mod_contents(p, true);
279 | p.expect(R_CURLY);
280 | }
Metadata
Metadata
Assignees
Labels
C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesCategory: Enhancement of lints, like adding more cases or adding help messagesL-suggestionLint: Improving, adding or fixing lint suggestionsLint: Improving, adding or fixing lint suggestions