From aa7fd563a4b8817223ac50fa22cd946ce354f47d Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 27 Nov 2018 18:45:16 +0300 Subject: use ctry --- crates/ra_analysis/src/imp.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'crates/ra_analysis/src/imp.rs') 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 { let syntax = file.syntax(); // Find the calling expression and it's NameRef - let calling_node = match FnCallNode::with_node(syntax, position.offset) { - Some(node) => node, - None => return Ok(None), - }; - let name_ref = match calling_node.name_ref() { - Some(name) => name, - None => return Ok(None), - }; + let calling_node = ctry!(FnCallNode::with_node(syntax, position.offset)); + let name_ref = ctry!(calling_node.name_ref()); // Resolve the function's NameRef (NOTE: this isn't entirely accurate). let file_symbols = self.index_resolve(name_ref)?; -- cgit v1.2.3