diff --git a/src/book/book.rs b/src/book/book.rs index 048aef28..e3d87600 100644 --- a/src/book/book.rs +++ b/src/book/book.rs @@ -74,10 +74,10 @@ fn create_missing(src_dir: &Path, summary: &Summary) -> Result<()> { /// [`iter()`]: #method.iter /// [`for_each_mut()`]: #method.for_each_mut #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)] +#[non_exhaustive] pub struct Book { /// The sections in this book. pub sections: Vec, - __non_exhaustive: (), } impl Book { @@ -200,10 +200,7 @@ impl Chapter { /// Check if the chapter is a draft chapter, meaning it has no path to a source markdown file. pub fn is_draft_chapter(&self) -> bool { - match self.path { - Some(_) => false, - None => true, - } + self.path.is_none() } } @@ -228,10 +225,7 @@ pub(crate) fn load_book_from_disk>(summary: &Summary, src_dir: P) chapters.push(chapter); } - Ok(Book { - sections: chapters, - __non_exhaustive: (), - }) + Ok(Book { sections: chapters }) } fn load_summary_item + Clone>( diff --git a/src/renderer/mod.rs b/src/renderer/mod.rs index 05a5ac6f..9d2952c1 100644 --- a/src/renderer/mod.rs +++ b/src/renderer/mod.rs @@ -166,7 +166,7 @@ impl CmdRenderer { } else { // Let this bubble through to later be handled by // handle_render_command_error. - abs_exe.to_path_buf() + abs_exe } } };