Skip to content

Commit ad9afb2

Browse files
committed
Simplify
1 parent 5bf6698 commit ad9afb2

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

crates/ra_ide/src/goto_type_definition.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@ pub(crate) fn goto_type_definition(
1616
let token = pick_best(file.token_at_offset(position.offset))?;
1717
let token = descend_into_macros(db, position.file_id, token);
1818

19-
let node = token.value.ancestors().find_map(|token| {
20-
token
21-
.ancestors()
22-
.find(|n| ast::Expr::cast(n.clone()).is_some() || ast::Pat::cast(n.clone()).is_some())
23-
})?;
19+
let node = token
20+
.value
21+
.ancestors()
22+
.find(|n| ast::Expr::cast(n.clone()).is_some() || ast::Pat::cast(n.clone()).is_some())?;
2423

2524
let analyzer = hir::SourceAnalyzer::new(db, token.with_value(&node), None);
2625

0 commit comments

Comments
 (0)