Skip to content

Commit 22ea5fe

Browse files
authored
Merge pull request #1557 from xrmx/cargo-clippy-fixes
Some clippy fixes
2 parents 8201b41 + 714c5fb commit 22ea5fe

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

src/book/book.rs

+3-9
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ fn create_missing(src_dir: &Path, summary: &Summary) -> Result<()> {
7474
/// [`iter()`]: #method.iter
7575
/// [`for_each_mut()`]: #method.for_each_mut
7676
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
77+
#[non_exhaustive]
7778
pub struct Book {
7879
/// The sections in this book.
7980
pub sections: Vec<BookItem>,
80-
__non_exhaustive: (),
8181
}
8282

8383
impl Book {
@@ -200,10 +200,7 @@ impl Chapter {
200200

201201
/// Check if the chapter is a draft chapter, meaning it has no path to a source markdown file.
202202
pub fn is_draft_chapter(&self) -> bool {
203-
match self.path {
204-
Some(_) => false,
205-
None => true,
206-
}
203+
self.path.is_none()
207204
}
208205
}
209206

@@ -228,10 +225,7 @@ pub(crate) fn load_book_from_disk<P: AsRef<Path>>(summary: &Summary, src_dir: P)
228225
chapters.push(chapter);
229226
}
230227

231-
Ok(Book {
232-
sections: chapters,
233-
__non_exhaustive: (),
234-
})
228+
Ok(Book { sections: chapters })
235229
}
236230

237231
fn load_summary_item<P: AsRef<Path> + Clone>(

src/renderer/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ impl CmdRenderer {
166166
} else {
167167
// Let this bubble through to later be handled by
168168
// handle_render_command_error.
169-
abs_exe.to_path_buf()
169+
abs_exe
170170
}
171171
}
172172
};

0 commit comments

Comments
 (0)