From a89206795140209b816eb8e91fa3f1e1d6509269 Mon Sep 17 00:00:00 2001 From: Jeremy Kolb Date: Sat, 26 Jan 2019 10:35:23 -0500 Subject: Make doc comments optional --- crates/ra_ide_api/src/call_info.rs | 3 +-- crates/ra_ide_api/src/hover.rs | 7 +------ 2 files changed, 2 insertions(+), 8 deletions(-) (limited to 'crates/ra_ide_api/src') diff --git a/crates/ra_ide_api/src/call_info.rs b/crates/ra_ide_api/src/call_info.rs index 3267fff96..7554c4aee 100644 --- a/crates/ra_ide_api/src/call_info.rs +++ b/crates/ra_ide_api/src/call_info.rs @@ -120,8 +120,7 @@ impl CallInfo { }; let mut doc = None; - let docs = node.doc_comment_text(); - if !docs.is_empty() { + if let Some(docs) = node.doc_comment_text() { // Massage markdown let mut processed_lines = Vec::new(); let mut in_code_block = false; diff --git a/crates/ra_ide_api/src/hover.rs b/crates/ra_ide_api/src/hover.rs index ff9ae2d9c..f993a461c 100644 --- a/crates/ra_ide_api/src/hover.rs +++ b/crates/ra_ide_api/src/hover.rs @@ -100,12 +100,7 @@ impl NavigationTarget { fn docs(&self, db: &RootDatabase) -> Option { let node = self.node(db)?; fn doc_comments(node: &N) -> Option { - let comments = node.doc_comment_text(); - if comments.is_empty() { - None - } else { - Some(comments) - } + node.doc_comment_text() } visitor() -- cgit v1.2.3