mirror of
https://github.com/rust-lang/mdBook
synced 2024-12-14 14:52:37 +00:00
book: use non_exhaustive attribute for struct Book
As suggested by clippy: https://rust-lang.github.io/rust-clippy/master/index.html#manual_non_exhaustive
This commit is contained in:
parent
8201b411ab
commit
c1b2bec7d7
1 changed files with 2 additions and 5 deletions
|
@ -74,10 +74,10 @@ fn create_missing(src_dir: &Path, summary: &Summary) -> Result<()> {
|
||||||
/// [`iter()`]: #method.iter
|
/// [`iter()`]: #method.iter
|
||||||
/// [`for_each_mut()`]: #method.for_each_mut
|
/// [`for_each_mut()`]: #method.for_each_mut
|
||||||
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
|
||||||
|
#[non_exhaustive]
|
||||||
pub struct Book {
|
pub struct Book {
|
||||||
/// The sections in this book.
|
/// The sections in this book.
|
||||||
pub sections: Vec<BookItem>,
|
pub sections: Vec<BookItem>,
|
||||||
__non_exhaustive: (),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Book {
|
impl Book {
|
||||||
|
@ -228,10 +228,7 @@ pub(crate) fn load_book_from_disk<P: AsRef<Path>>(summary: &Summary, src_dir: P)
|
||||||
chapters.push(chapter);
|
chapters.push(chapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(Book {
|
Ok(Book { sections: chapters })
|
||||||
sections: chapters,
|
|
||||||
__non_exhaustive: (),
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn load_summary_item<P: AsRef<Path> + Clone>(
|
fn load_summary_item<P: AsRef<Path> + Clone>(
|
||||||
|
|
Loading…
Reference in a new issue