diff --git a/src/book/book.rs b/src/book/book.rs index 3531de38..96c70abc 100644 --- a/src/book/book.rs +++ b/src/book/book.rs @@ -39,9 +39,7 @@ fn create_missing(src_dir: &Path, summary: &Summary) -> Result<()> { .chain(summary.suffix_chapters.iter()) .collect(); - while !items.is_empty() { - let next = items.pop().expect("already checked"); - + while let Some(next) = items.pop() { if let SummaryItem::Link(ref link) = *next { if let Some(ref location) = link.location { let filename = src_dir.join(location);