From d618b1f2ce25db8817d1649d7ec7720594789067 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Mon, 7 Jan 2019 01:10:29 +0100 Subject: if let -> match --- crates/ra_hir/src/ty/tests.rs | 14 ++++++-------- 1 file 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 { let body_syntax_mapping = func.body_syntax_mapping(&db).unwrap(); let mut types = Vec::new(); for (pat, ty) in inference_result.type_of_pat.iter() { - let syntax_ptr = if let Some(sp) = body_syntax_mapping.pat_syntax(pat) { - sp - } else { - continue; + let syntax_ptr = match body_syntax_mapping.pat_syntax(pat) { + Some(sp) => sp, + None => continue, }; types.push((syntax_ptr, ty)); } for (expr, ty) in inference_result.type_of_expr.iter() { - let syntax_ptr = if let Some(sp) = body_syntax_mapping.expr_syntax(expr) { - sp - } else { - continue; + let syntax_ptr = match body_syntax_mapping.expr_syntax(expr) { + Some(sp) => sp, + None => continue, }; types.push((syntax_ptr, ty)); } -- cgit v1.2.3