diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-10-22 22:14:38 +0100 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-10-22 22:14:38 +0100 |
commit | 27694abd9473c53cee4549dfe5ef5d28d0c01bed (patch) | |
tree | 6f51587dc28fc8fe28c0971a810541421ea2d829 /crates/ra_syntax/src/grammar | |
parent | 5a64b9a811554473e65db7e7ae515079ca48c70b (diff) | |
parent | dc9ce8ff7494f641c7102785cdef95489f2fc3d6 (diff) |
Merge #138
138: Fix some clippy lints r=matklad a=alanhdu
I went ahead and fixed all the clippy lints (there were a couple I thought would be better unfixed and added `cfg` statements to allow them) and also re-enabled clippy and rustfmt in CI.
They were disabled with `no time to explain, disable clippy checks`, so hopefully this won't go against whatever the reason at the time was :laughing:.
One question about the CI though: right now, it's an allowed failure that runs against the latest nightly each time. Would it be better to pin it to a specific nightly (or use the `beta` versions) to lower the churn?
Co-authored-by: Alan Du <[email protected]>
Diffstat (limited to 'crates/ra_syntax/src/grammar')
-rw-r--r-- | crates/ra_syntax/src/grammar/expressions/atom.rs | 5 | ||||
-rw-r--r-- | crates/ra_syntax/src/grammar/items/mod.rs | 6 | ||||
-rw-r--r-- | crates/ra_syntax/src/grammar/patterns.rs | 5 |
3 files changed, 6 insertions, 10 deletions
diff --git a/crates/ra_syntax/src/grammar/expressions/atom.rs b/crates/ra_syntax/src/grammar/expressions/atom.rs index 11f766d33..04087fd60 100644 --- a/crates/ra_syntax/src/grammar/expressions/atom.rs +++ b/crates/ra_syntax/src/grammar/expressions/atom.rs | |||
@@ -62,9 +62,8 @@ pub(super) const ATOM_EXPR_FIRST: TokenSet = token_set_union![ | |||
62 | const EXPR_RECOVERY_SET: TokenSet = token_set![LET_KW]; | 62 | const EXPR_RECOVERY_SET: TokenSet = token_set![LET_KW]; |
63 | 63 | ||
64 | pub(super) fn atom_expr(p: &mut Parser, r: Restrictions) -> Option<CompletedMarker> { | 64 | pub(super) fn atom_expr(p: &mut Parser, r: Restrictions) -> Option<CompletedMarker> { |
65 | match literal(p) { | 65 | if let Some(m) = literal(p) { |
66 | Some(m) => return Some(m), | 66 | return Some(m); |
67 | None => (), | ||
68 | } | 67 | } |
69 | if paths::is_path_start(p) || p.at(L_ANGLE) { | 68 | if paths::is_path_start(p) || p.at(L_ANGLE) { |
70 | return Some(path_expr(p, r)); | 69 | return Some(path_expr(p, r)); |
diff --git a/crates/ra_syntax/src/grammar/items/mod.rs b/crates/ra_syntax/src/grammar/items/mod.rs index dc4742bce..06c6b5e6e 100644 --- a/crates/ra_syntax/src/grammar/items/mod.rs +++ b/crates/ra_syntax/src/grammar/items/mod.rs | |||
@@ -352,7 +352,7 @@ fn macro_call(p: &mut Parser) -> BlockLike { | |||
352 | pub(super) fn macro_call_after_excl(p: &mut Parser) -> BlockLike { | 352 | pub(super) fn macro_call_after_excl(p: &mut Parser) -> BlockLike { |
353 | p.expect(EXCL); | 353 | p.expect(EXCL); |
354 | p.eat(IDENT); | 354 | p.eat(IDENT); |
355 | let flavor = match p.current() { | 355 | match p.current() { |
356 | L_CURLY => { | 356 | L_CURLY => { |
357 | token_tree(p); | 357 | token_tree(p); |
358 | BlockLike::Block | 358 | BlockLike::Block |
@@ -365,9 +365,7 @@ pub(super) fn macro_call_after_excl(p: &mut Parser) -> BlockLike { | |||
365 | p.error("expected `{`, `[`, `(`"); | 365 | p.error("expected `{`, `[`, `(`"); |
366 | BlockLike::NotBlock | 366 | BlockLike::NotBlock |
367 | } | 367 | } |
368 | }; | 368 | } |
369 | |||
370 | flavor | ||
371 | } | 369 | } |
372 | 370 | ||
373 | pub(crate) fn token_tree(p: &mut Parser) { | 371 | pub(crate) fn token_tree(p: &mut Parser) { |
diff --git a/crates/ra_syntax/src/grammar/patterns.rs b/crates/ra_syntax/src/grammar/patterns.rs index 9d35dbb3d..10fa0e0be 100644 --- a/crates/ra_syntax/src/grammar/patterns.rs +++ b/crates/ra_syntax/src/grammar/patterns.rs | |||
@@ -49,9 +49,8 @@ fn atom_pat(p: &mut Parser, recovery_set: TokenSet) -> Option<CompletedMarker> { | |||
49 | // "hello" => (), | 49 | // "hello" => (), |
50 | // } | 50 | // } |
51 | // } | 51 | // } |
52 | match expressions::literal(p) { | 52 | if let Some(m) = expressions::literal(p) { |
53 | Some(m) => return Some(m), | 53 | return Some(m); |
54 | None => (), | ||
55 | } | 54 | } |
56 | 55 | ||
57 | let m = match la0 { | 56 | let m = match la0 { |