Refactor to prevent excessive indentation.

This commit is contained in:
Corey Farwell 2017-04-17 21:55:32 -04:00
parent c6e81337fb
commit 15dcca87d8
1 changed files with 15 additions and 16 deletions

View File

@ -180,10 +180,11 @@ impl MDBook {
debug!("[*]: constructing paths for missing files");
for item in self.iter() {
debug!("[*]: item: {:?}", item);
match *item {
let ch = match *item {
BookItem::Spacer => continue,
BookItem::Chapter(_, ref ch) |
BookItem::Affix(ref ch) => {
BookItem::Affix(ref ch) => ch,
};
if ch.path != PathBuf::new() {
let path = self.src.join(&ch.path);
@ -199,8 +200,6 @@ impl MDBook {
try!(writeln!(f, "# {}", ch.name));
}
}
},
}
}
debug!("[*]: init done");