diff --git a/src/bin/concat_chapters.rs b/src/bin/concat_chapters.rs index 8afb566ee..94a4e422d 100644 --- a/src/bin/concat_chapters.rs +++ b/src/bin/concat_chapters.rs @@ -87,7 +87,9 @@ fn concat_files(source_paths: Vec, target_path: PathBuf) -> io::Result< let mut contents: Vec = Vec::new(); try!(source.read_to_end(&mut contents)); - if !is_first { + if is_first { + try!(target.write_all(b"\n[TOC]\n\n")); + } else { try!(target.write_all(b"\n")); } try!(target.write_all(&contents)); diff --git a/src/ch02-00-guessing-game-tutorial.md b/src/ch02-00-guessing-game-tutorial.md index 302ac56f6..cc9bfc3cb 100644 --- a/src/ch02-00-guessing-game-tutorial.md +++ b/src/ch02-00-guessing-game-tutorial.md @@ -1,6 +1,3 @@ - -[TOC] - # Guessing Game Let's jump into Rust with a hands-on project! This chapter will introduce you to