Rewrite an emptiness check.

This commit is contained in:
Corey Farwell 2017-04-17 21:58:34 -04:00
parent 5d72d966ad
commit 4525810737

View file

@ -185,7 +185,7 @@ impl MDBook {
BookItem::Chapter(_, ref ch) | BookItem::Chapter(_, ref ch) |
BookItem::Affix(ref ch) => ch, BookItem::Affix(ref ch) => ch,
}; };
if ch.path != PathBuf::new() { if ch.path.as_os_str().is_empty() {
let path = self.src.join(&ch.path); let path = self.src.join(&ch.path);
if !path.exists() { if !path.exists() {