diff options
author | Florian Diebold <[email protected]> | 2020-03-16 17:46:08 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2020-03-16 17:46:08 +0000 |
commit | 6c20d7e979b967eb20207414c0a0bf875bbcb98d (patch) | |
tree | 55d4c8053534fddf5575b6a1480a964593f1f548 | |
parent | 32dce75747271236be0ca8762b338c317bd48204 (diff) |
Small fixes
-rw-r--r-- | crates/ra_mbe/src/mbe_expander.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/crates/ra_mbe/src/mbe_expander.rs b/crates/ra_mbe/src/mbe_expander.rs index 7adb70d45..b1eacf124 100644 --- a/crates/ra_mbe/src/mbe_expander.rs +++ b/crates/ra_mbe/src/mbe_expander.rs | |||
@@ -34,8 +34,7 @@ fn expand_rules(rules: &[crate::Rule], input: &tt::Subtree) -> ExpandResult<tt:: | |||
34 | return ExpandResult::ok(res); | 34 | return ExpandResult::ok(res); |
35 | } | 35 | } |
36 | } | 36 | } |
37 | // Use the rule if we matched more tokens, or had fewer patterns left, | 37 | // Use the rule if we matched more tokens, or had fewer errors |
38 | // or had no error | ||
39 | if let Some((prev_match, _)) = &match_ { | 38 | if let Some((prev_match, _)) = &match_ { |
40 | if (new_match.unmatched_tts, new_match.err_count) | 39 | if (new_match.unmatched_tts, new_match.err_count) |
41 | < (prev_match.unmatched_tts, prev_match.err_count) | 40 | < (prev_match.unmatched_tts, prev_match.err_count) |
@@ -176,7 +175,6 @@ mod tests { | |||
176 | let (invocation_tt, _) = | 175 | let (invocation_tt, _) = |
177 | ast_to_token_tree(¯o_invocation.token_tree().unwrap()).unwrap(); | 176 | ast_to_token_tree(¯o_invocation.token_tree().unwrap()).unwrap(); |
178 | 177 | ||
179 | let expanded = expand_rules(&rules.rules, &invocation_tt); | 178 | expand_rules(&rules.rules, &invocation_tt) |
180 | expanded | ||
181 | } | 179 | } |
182 | } | 180 | } |