diff options
author | Florian Diebold <[email protected]> | 2019-01-07 00:10:29 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2019-01-07 00:10:29 +0000 |
commit | d618b1f2ce25db8817d1649d7ec7720594789067 (patch) | |
tree | d3d006919d15d6a26ff1a8091cf1e5341842c1aa /crates/ra_hir | |
parent | 2dfb5e6ac03e9cc6973dffe9ad69e858510604ee (diff) |
if let -> match
Diffstat (limited to 'crates/ra_hir')
-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 | } |