Merge pull request #1572 from joshrotenberg/revert-c1b2bec7d7a56909f695f103d316453dab68798e

Revert "book: use non_exhaustive attribute for struct Book"
This commit is contained in:
Eric Huss 2021-06-08 14:54:51 -07:00 committed by GitHub
commit d9ce98d710
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -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 {
@ -225,7 +225,10 @@ pub(crate) fn load_book_from_disk<P: AsRef<Path>>(summary: &Summary, src_dir: P)
chapters.push(chapter); chapters.push(chapter);
} }
Ok(Book { sections: chapters }) Ok(Book {
sections: chapters,
__non_exhaustive: (),
})
} }
fn load_summary_item<P: AsRef<Path> + Clone>( fn load_summary_item<P: AsRef<Path> + Clone>(