diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_hir/src/ty/tests.rs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs index 030a20f1b..83aedaa00 100644 --- a/crates/ra_hir/src/ty/tests.rs +++ b/crates/ra_hir/src/ty/tests.rs | |||
@@ -196,18 +196,16 @@ fn infer(content: &str) -> String { | |||
196 | let body_syntax_mapping = func.body_syntax_mapping(&db).unwrap(); | 196 | let body_syntax_mapping = func.body_syntax_mapping(&db).unwrap(); |
197 | let mut types = Vec::new(); | 197 | let mut types = Vec::new(); |
198 | for (pat, ty) in inference_result.type_of_pat.iter() { | 198 | for (pat, ty) in inference_result.type_of_pat.iter() { |
199 | let syntax_ptr = if let Some(sp) = body_syntax_mapping.pat_syntax(pat) { | 199 | let syntax_ptr = match body_syntax_mapping.pat_syntax(pat) { |
200 | sp | 200 | Some(sp) => sp, |
201 | } else { | 201 | None => continue, |
202 | continue; | ||
203 | }; | 202 | }; |
204 | types.push((syntax_ptr, ty)); | 203 | types.push((syntax_ptr, ty)); |
205 | } | 204 | } |
206 | for (expr, ty) in inference_result.type_of_expr.iter() { | 205 | for (expr, ty) in inference_result.type_of_expr.iter() { |
207 | let syntax_ptr = if let Some(sp) = body_syntax_mapping.expr_syntax(expr) { | 206 | let syntax_ptr = match body_syntax_mapping.expr_syntax(expr) { |
208 | sp | 207 | Some(sp) => sp, |
209 | } else { | 208 | None => continue, |
210 | continue; | ||
211 | }; | 209 | }; |
212 | types.push((syntax_ptr, ty)); | 210 | types.push((syntax_ptr, ty)); |
213 | } | 211 | } |