From c29f158c20ba57fc4a7067a493d79c38884ea1ec Mon Sep 17 00:00:00 2001 From: "Jeremy A. Kolb" Date: Wed, 7 Nov 2018 09:13:16 -0500 Subject: Rustfmt to pass CI --- crates/ra_analysis/src/lib.rs | 2 +- crates/ra_editor/src/symbols.rs | 12 +++++++++--- crates/ra_lsp_server/src/main_loop/handlers.rs | 4 ++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/crates/ra_analysis/src/lib.rs b/crates/ra_analysis/src/lib.rs index db4e1ba86..9475c938d 100644 --- a/crates/ra_analysis/src/lib.rs +++ b/crates/ra_analysis/src/lib.rs @@ -261,7 +261,7 @@ impl Analysis { pub fn doc_comment_for( &self, file_id: FileId, - symbol: FileSymbol + symbol: FileSymbol, ) -> Cancelable> { self.imp.doc_comment_for(file_id, symbol) } diff --git a/crates/ra_editor/src/symbols.rs b/crates/ra_editor/src/symbols.rs index bf3ac6ff2..f7681c76f 100644 --- a/crates/ra_editor/src/symbols.rs +++ b/crates/ra_editor/src/symbols.rs @@ -24,12 +24,17 @@ pub struct FileSymbol { impl FileSymbol { pub fn docs(&self, file: &File) -> Option { - file.syntax().descendants() + file.syntax() + .descendants() .filter(|node| node.kind() == self.kind && node.range() == self.node_range) .filter_map(|node: SyntaxNodeRef| { fn doc_comments<'a, N: DocCommentsOwner<'a>>(node: N) -> Option { let comments = node.doc_comment_text(); - if comments.is_empty() { None } else { Some(comments) } + if comments.is_empty() { + None + } else { + Some(comments) + } } visitor() @@ -42,7 +47,8 @@ impl FileSymbol { .visit(doc_comments::) .visit(doc_comments::) .accept(node)? - }).nth(0) + }) + .nth(0) } } diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index 3e9da8470..c872b0dc4 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs @@ -494,8 +494,8 @@ pub fn handle_hover( return Ok(Some(Hover { contents, - range: Some(range) - })) + range: Some(range), + })); } } -- cgit v1.2.3