Merge pull request #1557 from xrmx/cargo-clippy-fixes
Some clippy fixes
This commit is contained in:
commit
22ea5fe335
|
@ -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 {
|
||||||
|
@ -200,10 +200,7 @@ impl Chapter {
|
||||||
|
|
||||||
/// Check if the chapter is a draft chapter, meaning it has no path to a source markdown file.
|
/// 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 {
|
pub fn is_draft_chapter(&self) -> bool {
|
||||||
match self.path {
|
self.path.is_none()
|
||||||
Some(_) => false,
|
|
||||||
None => true,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -228,10 +225,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>(
|
||||||
|
|
|
@ -166,7 +166,7 @@ impl CmdRenderer {
|
||||||
} else {
|
} else {
|
||||||
// Let this bubble through to later be handled by
|
// Let this bubble through to later be handled by
|
||||||
// handle_render_command_error.
|
// handle_render_command_error.
|
||||||
abs_exe.to_path_buf()
|
abs_exe
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue