diff options
author | Aleksey Kladov <[email protected]> | 2018-12-27 21:08:33 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-12-27 21:08:33 +0000 |
commit | bc833216d7190d7a270ed2d831abc134fab91cfb (patch) | |
tree | a10ff2ac8882d9b0373bc5449a44e40696538a45 /crates/ra_analysis/src | |
parent | 58a631f39ab7d3219d7972a26f79b0716024adb3 (diff) |
simplify
Diffstat (limited to 'crates/ra_analysis/src')
-rw-r--r-- | crates/ra_analysis/src/imp.rs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/crates/ra_analysis/src/imp.rs b/crates/ra_analysis/src/imp.rs index 2556c022b..e6663810d 100644 --- a/crates/ra_analysis/src/imp.rs +++ b/crates/ra_analysis/src/imp.rs | |||
@@ -491,12 +491,7 @@ impl AnalysisImpl { | |||
491 | let file = self.db.source_file(file_id); | 491 | let file = self.db.source_file(file_id); |
492 | let syntax = file.syntax(); | 492 | let syntax = file.syntax(); |
493 | let node = find_covering_node(syntax, range); | 493 | let node = find_covering_node(syntax, range); |
494 | let parent_fn = node.ancestors().filter_map(FnDef::cast).next(); | 494 | let parent_fn = ctry!(node.ancestors().find_map(FnDef::cast)); |
495 | let parent_fn = if let Some(p) = parent_fn { | ||
496 | p | ||
497 | } else { | ||
498 | return Ok(None); | ||
499 | }; | ||
500 | let function = ctry!(source_binder::function_from_source( | 495 | let function = ctry!(source_binder::function_from_source( |
501 | &*self.db, file_id, parent_fn | 496 | &*self.db, file_id, parent_fn |
502 | )?); | 497 | )?); |