diff options
-rw-r--r-- | crates/ra_parser/src/grammar/expressions.rs | 12 | ||||
-rw-r--r-- | crates/ra_prof/src/lib.rs | 11 |
2 files changed, 10 insertions, 13 deletions
diff --git a/crates/ra_parser/src/grammar/expressions.rs b/crates/ra_parser/src/grammar/expressions.rs index 8df9035e9..9fe529f53 100644 --- a/crates/ra_parser/src/grammar/expressions.rs +++ b/crates/ra_parser/src/grammar/expressions.rs | |||
@@ -252,12 +252,12 @@ fn expr_bp( | |||
252 | // `newly_dollar_open` is a flag indicated that dollar is just closed after lhs, e.g. | 252 | // `newly_dollar_open` is a flag indicated that dollar is just closed after lhs, e.g. |
253 | // `$1$ + a` | 253 | // `$1$ + a` |
254 | // We use this flag to skip handling it. | 254 | // We use this flag to skip handling it. |
255 | let mut newly_dollar_open = false; | 255 | let mut newly_dollar_open = if p.at_l_dollar() { |
256 | |||
257 | if p.at_l_dollar() { | ||
258 | *dollar_lvl += p.eat_l_dollars(); | 256 | *dollar_lvl += p.eat_l_dollars(); |
259 | newly_dollar_open = true; | 257 | true |
260 | } | 258 | } else { |
259 | false | ||
260 | }; | ||
261 | 261 | ||
262 | let mut lhs = match lhs(p, r, dollar_lvl) { | 262 | let mut lhs = match lhs(p, r, dollar_lvl) { |
263 | Some((lhs, blocklike)) => { | 263 | Some((lhs, blocklike)) => { |
@@ -535,7 +535,7 @@ fn path_expr(p: &mut Parser, r: Restrictions) -> (CompletedMarker, BlockLike) { | |||
535 | } | 535 | } |
536 | EXCL => { | 536 | EXCL => { |
537 | let block_like = items::macro_call_after_excl(p); | 537 | let block_like = items::macro_call_after_excl(p); |
538 | return (m.complete(p, MACRO_CALL), block_like); | 538 | (m.complete(p, MACRO_CALL), block_like) |
539 | } | 539 | } |
540 | _ => (m.complete(p, PATH_EXPR), BlockLike::NotBlock), | 540 | _ => (m.complete(p, PATH_EXPR), BlockLike::NotBlock), |
541 | } | 541 | } |
diff --git a/crates/ra_prof/src/lib.rs b/crates/ra_prof/src/lib.rs index ba432912f..9ecb8e744 100644 --- a/crates/ra_prof/src/lib.rs +++ b/crates/ra_prof/src/lib.rs | |||
@@ -67,14 +67,11 @@ pub fn profile(desc: &str) -> Profiler { | |||
67 | 67 | ||
68 | PROFILE_STACK.with(|stack| { | 68 | PROFILE_STACK.with(|stack| { |
69 | let mut stack = stack.borrow_mut(); | 69 | let mut stack = stack.borrow_mut(); |
70 | if stack.starts.len() == 0 { | 70 | if stack.starts.is_empty() { |
71 | match FILTER.try_read() { | 71 | if let Ok(f) = FILTER.try_read() { |
72 | Ok(f) => { | 72 | if f.version > stack.filter_data.version { |
73 | if f.version > stack.filter_data.version { | 73 | stack.filter_data = f.clone(); |
74 | stack.filter_data = f.clone(); | ||
75 | } | ||
76 | } | 74 | } |
77 | Err(_) => (), | ||
78 | }; | 75 | }; |
79 | } | 76 | } |
80 | 77 | ||