Merge pull request #2823 from ehuss/non_exhaustive_remove
Remove non_exhaustive from Book
This commit is contained in:
commit
be63b44038
2 changed files with 12 additions and 4 deletions
|
|
@ -18,8 +18,11 @@ mod tests;
|
||||||
///
|
///
|
||||||
/// [`iter()`]: #method.iter
|
/// [`iter()`]: #method.iter
|
||||||
/// [`for_each_mut()`]: #method.for_each_mut
|
/// [`for_each_mut()`]: #method.for_each_mut
|
||||||
|
#[allow(
|
||||||
|
clippy::exhaustive_structs,
|
||||||
|
reason = "This cannot be extended without breaking preprocessors."
|
||||||
|
)]
|
||||||
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
|
||||||
#[non_exhaustive]
|
|
||||||
pub struct Book {
|
pub struct Book {
|
||||||
/// The items in this book.
|
/// The items in this book.
|
||||||
pub items: Vec<BookItem>,
|
pub items: Vec<BookItem>,
|
||||||
|
|
@ -80,8 +83,11 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Enum representing any type of item which can be added to a book.
|
/// Enum representing any type of item which can be added to a book.
|
||||||
|
#[allow(
|
||||||
|
clippy::exhaustive_enums,
|
||||||
|
reason = "This cannot be extended without breaking preprocessors."
|
||||||
|
)]
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||||
#[non_exhaustive]
|
|
||||||
pub enum BookItem {
|
pub enum BookItem {
|
||||||
/// A nested chapter.
|
/// A nested chapter.
|
||||||
Chapter(Chapter),
|
Chapter(Chapter),
|
||||||
|
|
@ -99,8 +105,11 @@ impl From<Chapter> for BookItem {
|
||||||
|
|
||||||
/// The representation of a "chapter", usually mapping to a single file on
|
/// The representation of a "chapter", usually mapping to a single file on
|
||||||
/// disk however it may contain multiple sub-chapters.
|
/// disk however it may contain multiple sub-chapters.
|
||||||
|
#[allow(
|
||||||
|
clippy::exhaustive_structs,
|
||||||
|
reason = "This cannot be extended without breaking preprocessors."
|
||||||
|
)]
|
||||||
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
|
||||||
#[non_exhaustive]
|
|
||||||
pub struct Chapter {
|
pub struct Chapter {
|
||||||
/// The chapter's name.
|
/// The chapter's name.
|
||||||
pub name: String,
|
pub name: String,
|
||||||
|
|
|
||||||
|
|
@ -687,7 +687,6 @@ fn make_data(
|
||||||
BookItem::Separator => {
|
BookItem::Separator => {
|
||||||
chapter.insert("spacer".to_owned(), json!("_spacer_"));
|
chapter.insert("spacer".to_owned(), json!("_spacer_"));
|
||||||
}
|
}
|
||||||
_ => panic!("BookItem {item:?} not covered"),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
chapters.push(chapter);
|
chapters.push(chapter);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue