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_hir/src/docs.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'crates/ra_hir/src') diff --git a/crates/ra_hir/src/docs.rs b/crates/ra_hir/src/docs.rs index b1b47af9e..5db72c08a 100644 --- a/crates/ra_hir/src/docs.rs +++ b/crates/ra_hir/src/docs.rs @@ -27,10 +27,5 @@ pub trait Docs { } pub(crate) fn docs_from_ast(node: &impl ast::DocCommentsOwner) -> Option { - let comments = node.doc_comment_text(); - if comments.is_empty() { - None - } else { - Some(Documentation::new(&comments)) - } + node.doc_comment_text().map(|it| Documentation::new(&it)) } -- cgit v1.2.3