aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis/src/imp.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-11-27 15:45:16 +0000
committerAleksey Kladov <[email protected]>2018-11-27 15:45:16 +0000
commitaa7fd563a4b8817223ac50fa22cd946ce354f47d (patch)
tree17537d030ec76cac6c107de165edc522d902b5e5 /crates/ra_analysis/src/imp.rs
parentf4860870dae309f5287a287de0aa3a1a1b1de36b (diff)
use ctry
Diffstat (limited to 'crates/ra_analysis/src/imp.rs')
-rw-r--r--crates/ra_analysis/src/imp.rs10
1 files changed, 2 insertions, 8 deletions
diff --git a/crates/ra_analysis/src/imp.rs b/crates/ra_analysis/src/imp.rs
index ad6b52371..8a41b3152 100644
--- a/crates/ra_analysis/src/imp.rs
+++ b/crates/ra_analysis/src/imp.rs
@@ -450,14 +450,8 @@ impl AnalysisImpl {
450 let syntax = file.syntax(); 450 let syntax = file.syntax();
451 451
452 // Find the calling expression and it's NameRef 452 // Find the calling expression and it's NameRef
453 let calling_node = match FnCallNode::with_node(syntax, position.offset) { 453 let calling_node = ctry!(FnCallNode::with_node(syntax, position.offset));
454 Some(node) => node, 454 let name_ref = ctry!(calling_node.name_ref());
455 None => return Ok(None),
456 };
457 let name_ref = match calling_node.name_ref() {
458 Some(name) => name,
459 None => return Ok(None),
460 };
461 455
462 // Resolve the function's NameRef (NOTE: this isn't entirely accurate). 456 // Resolve the function's NameRef (NOTE: this isn't entirely accurate).
463 let file_symbols = self.index_resolve(name_ref)?; 457 let file_symbols = self.index_resolve(name_ref)?;