Merge pull request #1557 from xrmx/cargo-clippy-fixes

Some clippy fixes
This commit is contained in:
Eric Huss 2021-05-31 07:10:30 -07:00 committed by GitHub
commit 22ea5fe335
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 10 deletions

View File

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

View File

@ -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
}
}
};