From 515c3bc59bfc227cbbb82f80b53c5c125be4fc30 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sun, 23 Dec 2018 12:15:46 +0100 Subject: Cleanup --- crates/ra_analysis/src/imp.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'crates/ra_analysis/src') diff --git a/crates/ra_analysis/src/imp.rs b/crates/ra_analysis/src/imp.rs index 4e0631679..f2912d235 100644 --- a/crates/ra_analysis/src/imp.rs +++ b/crates/ra_analysis/src/imp.rs @@ -516,8 +516,14 @@ impl AnalysisImpl { let syntax = file.syntax(); let node = find_covering_node(syntax, range); let parent_fn = node.ancestors().filter_map(FnDef::cast).next(); - let parent_fn = if let Some(p) = parent_fn { p } else { return Ok(None) }; - let function = ctry!(source_binder::function_from_source(&*self.db, file_id, parent_fn)?); + let parent_fn = if let Some(p) = parent_fn { + p + } else { + return Ok(None); + }; + let function = ctry!(source_binder::function_from_source( + &*self.db, file_id, parent_fn + )?); let infer = function.infer(&*self.db); Ok(infer.type_of_node(node).map(|t| t.to_string())) } -- cgit v1.2.3