mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-15 09:27:27 +00:00
simplify match
This commit is contained in:
parent
f69bf6a12b
commit
558bdf73c8
1 changed files with 1 additions and 4 deletions
|
@ -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]))
|
||||
|
|
Loading…
Reference in a new issue