From ab2fd11078772e0fec20986dd1d5a3731f08b507 Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Sun, 25 Aug 2019 21:33:48 -0400 Subject: [PATCH 1/5] Update version of mdbook used to what rust-lang/rust uses --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d8247288d4..d9a907c9fc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,6 @@ addons: - aspell - aspell-en before_script: - - (cargo install mdbook --vers 0.2.3 --force || true) + - (cargo install mdbook --vers 0.3.5 --force || true) script: - bash ci/build.sh From c13f3512a7ee179e281053c0e2922ec06801b3e5 Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Sat, 28 Sep 2019 21:43:25 -0400 Subject: [PATCH 2/5] Document that the code listings are available on the releases tab --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6dd1d9f373..7075fa40a3 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This repository contains the source of "The Rust Programming Language" book. -[The book is available in dead-tree form from No Starch Press][nostarch] +[The book is available in dead-tree form from No Starch Press][nostarch]. [nostarch]: https://nostarch.com/rust @@ -17,6 +17,10 @@ releases are updated less frequently. [beta]: https://doc.rust-lang.org/beta/book/ [nightly]: https://doc.rust-lang.org/nightly/book/ +See the [releases] to download just the code of all the code listings that appear in the book. + +[releases]: https://github.com/rust-lang/book/releases + ## Requirements Building the book requires [mdBook], ideally the same 0.3.x version that From 33a4906b57fcce8684fdc2a9d948ca8f58553c71 Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Sun, 29 Sep 2019 19:44:12 -0400 Subject: [PATCH 3/5] Remove code that handles figure/figcaption markup; we don't use that anymore --- tools/src/bin/remove_markup.rs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/tools/src/bin/remove_markup.rs b/tools/src/bin/remove_markup.rs index 2c285b9ab8..a4d352d131 100644 --- a/tools/src/bin/remove_markup.rs +++ b/tools/src/bin/remove_markup.rs @@ -28,15 +28,8 @@ fn remove_markup(input: String) -> String { let regexen = vec![filename_regex, caption_start_regex, caption_end_regex]; let lines: Vec<_> = input.lines().flat_map(|line| { - // Remove our figure and caption markup. - if line == "
" || - line == "
" || - line == "
" || - line == "
" - { - None // Remove our syntax highlighting and rustdoc markers. - } else if line.starts_with("```") { + if line.starts_with("```") { Some(String::from("```")) // Remove the span around filenames and captions. } else { From 09c1fe6ab5aabdb6e0dc4e377243811903921a58 Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Sun, 29 Sep 2019 19:57:43 -0400 Subject: [PATCH 4/5] Alphabetize bins --- Cargo.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b86be477ca..3254231c04 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,6 +9,10 @@ edition = "2018" name = "concat_chapters" path = "tools/src/bin/concat_chapters.rs" +[[bin]] +name = "convert_quotes" +path = "tools/src/bin/convert_quotes.rs" + [[bin]] name = "lfp" path = "tools/src/bin/lfp.rs" @@ -25,10 +29,6 @@ path = "tools/src/bin/remove_links.rs" name = "remove_markup" path = "tools/src/bin/remove_markup.rs" -[[bin]] -name = "convert_quotes" -path = "tools/src/bin/convert_quotes.rs" - [dependencies] walkdir = "0.1.5" docopt = "0.6.82" From 07f43ed878415688d1e575e904dc259e75987a0d Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Wed, 23 Oct 2019 10:42:27 -0400 Subject: [PATCH 5/5] Unignoring an example that works now --- src/ch04-02-references-and-borrowing.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/ch04-02-references-and-borrowing.md b/src/ch04-02-references-and-borrowing.md index f75d5c91b8..985f17f172 100644 --- a/src/ch04-02-references-and-borrowing.md +++ b/src/ch04-02-references-and-borrowing.md @@ -234,11 +234,7 @@ through the last time that reference is used. For instance, this code will compile because the last usage of the immutable references occurs before the mutable reference is introduced: - - -```rust,edition2018,ignore +```rust,edition2018 let mut s = String::from("hello"); let r1 = &s; // no problem