Skip to content

Commit a8b0e40

Browse files
Improve code readability
1 parent f767f54 commit a8b0e40

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

src/librustdoc/core.rs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -414,19 +414,18 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
414414
let mut krate = clean::krate(&mut ctxt);
415415

416416
if let Some(ref m) = krate.module {
417-
match m.doc_value() {
418-
None | Some("") => {
419-
let mut diag = tcx.struct_lint_node(
420-
rustc_lint::builtin::MISSING_CRATE_LEVEL_DOC,
421-
ctxt.as_local_hir_id(m.def_id).unwrap(),
422-
"No documentation found on this crate top module.\n\n\
423-
Maybe you could be interested into looking at this documentation:\n\
424-
https://doc.rust-lang.org/nightly/rustdoc/how-to-write-documentation\
425-
.html"
426-
);
427-
diag.emit();
428-
}
429-
_ => {}
417+
if let None | Some("") = m.doc_value() {
418+
let mut diag = tcx.struct_lint_node(
419+
rustc_lint::builtin::MISSING_CRATE_LEVEL_DOC,
420+
ctxt.as_local_hir_id(m.def_id).unwrap(),
421+
"no documentation found for this crate's top-level module",
422+
);
423+
diag.help(
424+
"The following guide may be of use:\n\
425+
https://doc.rust-lang.org/nightly/rustdoc/how-to-write-documentation\
426+
.html",
427+
);
428+
diag.emit();
430429
}
431430
}
432431

0 commit comments

Comments
 (0)