aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkjeremy <[email protected]>2019-04-24 19:45:02 +0100
committerkjeremy <[email protected]>2019-04-24 19:45:02 +0100
commit558bdf73c848eaccf3f274248981f56771c0d5ad (patch)
tree2e84d86869e8b0e32ad17046db5eb25af5c35418
parentf69bf6a12b9e6165ad3e4630d2b10776006b943f (diff)
simplify match
-rw-r--r--crates/ra_ide_api/src/goto_type_definition.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/crates/ra_ide_api/src/goto_type_definition.rs b/crates/ra_ide_api/src/goto_type_definition.rs
index 08ef4a86d..e456ec5d6 100644
--- a/crates/ra_ide_api/src/goto_type_definition.rs
+++ b/crates/ra_ide_api/src/goto_type_definition.rs
@@ -30,10 +30,7 @@ pub(crate) fn goto_type_definition(
30 return None; 30 return None;
31 }; 31 };
32 32
33 let adt_def = ty.autoderef(db).find_map(|ty| match ty.as_adt() { 33 let adt_def = ty.autoderef(db).find_map(|ty| ty.as_adt().map(|adt| adt.0))?;
34 Some((adt_def, _)) => Some(adt_def),
35 None => None,
36 })?;
37 34
38 let nav = NavigationTarget::from_adt_def(db, adt_def); 35 let nav = NavigationTarget::from_adt_def(db, adt_def);
39 Some(RangeInfo::new(node.range(), vec![nav])) 36 Some(RangeInfo::new(node.range(), vec![nav]))