mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 13:13:34 +00:00
Add a test for doc(include)
Tiny code improvement.
This commit is contained in:
parent
177b3b27c4
commit
e1096e3310
3 changed files with 6 additions and 3 deletions
|
@ -53,16 +53,14 @@ impl MissingDoc {
|
|||
*self.doc_hidden_stack.last().expect("empty doc_hidden_stack")
|
||||
}
|
||||
|
||||
#[allow(clippy::needless_bool)]
|
||||
fn has_include(meta: Option<MetaItem>) -> bool {
|
||||
if_chain! {
|
||||
if let Some(meta) = meta;
|
||||
if let MetaItemKind::List(list) = meta.node;
|
||||
if let Some(meta) = list.get(0);
|
||||
if let Some(name) = meta.name();
|
||||
if name == "include";
|
||||
then {
|
||||
true
|
||||
name == "include"
|
||||
} else {
|
||||
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 a new issue