Improve code readability
This commit is contained in:
parent
f767f541e7
commit
a8b0e40487
1 changed files with 12 additions and 13 deletions
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue