Add a test for doc(include)
Tiny code improvement.
This commit is contained in:
parent
177b3b27c4
commit
e1096e3310
@ -53,16 +53,14 @@ impl MissingDoc {
|
|||||||
*self.doc_hidden_stack.last().expect("empty doc_hidden_stack")
|
*self.doc_hidden_stack.last().expect("empty doc_hidden_stack")
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(clippy::needless_bool)]
|
|
||||||
fn has_include(meta: Option<MetaItem>) -> bool {
|
fn has_include(meta: Option<MetaItem>) -> bool {
|
||||||
if_chain! {
|
if_chain! {
|
||||||
if let Some(meta) = meta;
|
if let Some(meta) = meta;
|
||||||
if let MetaItemKind::List(list) = meta.node;
|
if let MetaItemKind::List(list) = meta.node;
|
||||||
if let Some(meta) = list.get(0);
|
if let Some(meta) = list.get(0);
|
||||||
if let Some(name) = meta.name();
|
if let Some(name) = meta.name();
|
||||||
if name == "include";
|
|
||||||
then {
|
then {
|
||||||
true
|
name == "include"
|
||||||
} else {
|
} else {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
5
tests/ui/missing-doc-crate.rs
Normal file
5
tests/ui/missing-doc-crate.rs
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#![warn(clippy::missing_docs_in_private_items)]
|
||||||
|
#![feature(external_doc)]
|
||||||
|
#![doc(include = "../../README.md")]
|
||||||
|
|
||||||
|
fn main() {}
|
0
tests/ui/missing-doc-crate.stderr
Normal file
0
tests/ui/missing-doc-crate.stderr
Normal file
Loading…
Reference in New Issue
Block a user