diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-06-04 23:14:46 +0100 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-06-04 23:14:46 +0100 |
commit | 5deb907b4321d8328978d3322b0826b781814452 (patch) | |
tree | 2baa3b75b1ef62c02617c37ba9b800c41a3dd102 /crates/ra_parser | |
parent | 8bd0e844247dc28d6ceb24b00f3cc3396bd5bf03 (diff) | |
parent | aa30c4909ebb1e85f1591f465c9e2875aa4d394e (diff) |
Merge #1374
1374: Implement `cargo lint` and fix some clippy errors r=alanhdu a=alanhdu
This creates a `cargo lint` command that runs clippy with certain lints disabled. I've also gone ahead and fixed some of the lint errors, although there are many more still to go.
cc #848
Co-authored-by: Alan Du <[email protected]>
Diffstat (limited to 'crates/ra_parser')
-rw-r--r-- | crates/ra_parser/src/grammar.rs | 6 | ||||
-rw-r--r-- | crates/ra_parser/src/grammar/expressions.rs | 1 |
2 files changed, 3 insertions, 4 deletions
diff --git a/crates/ra_parser/src/grammar.rs b/crates/ra_parser/src/grammar.rs index cf603eba1..5997636d6 100644 --- a/crates/ra_parser/src/grammar.rs +++ b/crates/ra_parser/src/grammar.rs | |||
@@ -87,10 +87,8 @@ pub(crate) fn pattern(p: &mut Parser) { | |||
87 | } | 87 | } |
88 | 88 | ||
89 | pub(crate) fn stmt(p: &mut Parser, with_semi: bool) { | 89 | pub(crate) fn stmt(p: &mut Parser, with_semi: bool) { |
90 | let with_semi = match with_semi { | 90 | let with_semi = |
91 | true => expressions::StmtWithSemi::Yes, | 91 | if with_semi { expressions::StmtWithSemi::Yes } else { expressions::StmtWithSemi::No }; |
92 | false => expressions::StmtWithSemi::No, | ||
93 | }; | ||
94 | 92 | ||
95 | expressions::stmt(p, with_semi) | 93 | expressions::stmt(p, with_semi) |
96 | } | 94 | } |
diff --git a/crates/ra_parser/src/grammar/expressions.rs b/crates/ra_parser/src/grammar/expressions.rs index bb6c78b5f..99e32c4e8 100644 --- a/crates/ra_parser/src/grammar/expressions.rs +++ b/crates/ra_parser/src/grammar/expressions.rs | |||
@@ -454,6 +454,7 @@ fn method_call_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker { | |||
454 | // x.1i32; | 454 | // x.1i32; |
455 | // x.0x01; | 455 | // x.0x01; |
456 | // } | 456 | // } |
457 | #[allow(clippy::if_same_then_else)] | ||
457 | fn field_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker { | 458 | fn field_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker { |
458 | assert!(p.at(T![.])); | 459 | assert!(p.at(T![.])); |
459 | let m = lhs.precede(p); | 460 | let m = lhs.precede(p); |