simplify match

This commit is contained in:
kjeremy 2019-04-24 14:45:02 -04:00
parent f69bf6a12b
commit 558bdf73c8

View file

@ -30,10 +30,7 @@ pub(crate) fn goto_type_definition(
return None;
};
let adt_def = ty.autoderef(db).find_map(|ty| match ty.as_adt() {
Some((adt_def, _)) => Some(adt_def),
None => None,
})?;
let adt_def = ty.autoderef(db).find_map(|ty| ty.as_adt().map(|adt| adt.0))?;
let nav = NavigationTarget::from_adt_def(db, adt_def);
Some(RangeInfo::new(node.range(), vec![nav]))