From 56ceb627b88f42c5b3ae82a5468900d4894a1640 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Sun, 30 May 2021 14:54:19 +0200 Subject: [PATCH] book: simplify is_draft_chapter As suggested by clippy: https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching --- src/book/book.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/book/book.rs b/src/book/book.rs index ae64b120..e3d87600 100644 --- a/src/book/book.rs +++ b/src/book/book.rs @@ -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() } }