about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2020-02-11 13:16:38 +0100
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2020-03-22 13:01:42 +0100
commita8b0e404875c1e08b330ddea1a2b9a520c193097 (patch)
tree1e7126f0afaaddb1adfbcafc3caecedbafb39a7d /src
parentf767f541e7a7eed4cd827511146372021acacc22 (diff)
downloadrust-a8b0e404875c1e08b330ddea1a2b9a520c193097.tar.gz
rust-a8b0e404875c1e08b330ddea1a2b9a520c193097.zip
Improve code readability
Diffstat (limited to 'src')
-rw-r--r--src/librustdoc/core.rs25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs
index 47b6699368c..116bb70dcf6 100644
--- a/src/librustdoc/core.rs
+++ b/src/librustdoc/core.rs
@@ -414,19 +414,18 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
                 let mut krate = clean::krate(&mut ctxt);
 
                 if let Some(ref m) = krate.module {
-                    match m.doc_value() {
-                        None | Some("") => {
-                            let mut diag = tcx.struct_lint_node(
-                                rustc_lint::builtin::MISSING_CRATE_LEVEL_DOC,
-                                ctxt.as_local_hir_id(m.def_id).unwrap(),
-                                "No documentation found on this crate top module.\n\n\
-                                 Maybe you could be interested into looking at this documentation:\n\
-                                 https://doc.rust-lang.org/nightly/rustdoc/how-to-write-documentation\
-                                 .html"
-                            );
-                            diag.emit();
-                        }
-                        _ => {}
+                    if let None | Some("") = m.doc_value() {
+                        let mut diag = tcx.struct_lint_node(
+                            rustc_lint::builtin::MISSING_CRATE_LEVEL_DOC,
+                            ctxt.as_local_hir_id(m.def_id).unwrap(),
+                            "no documentation found for this crate's top-level module",
+                        );
+                        diag.help(
+                            "The following guide may be of use:\n\
+                             https://doc.rust-lang.org/nightly/rustdoc/how-to-write-documentation\
+                             .html",
+                        );
+                        diag.emit();
                     }
                 }