Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small cleanups extracted from the bigger pr i'm working on #2212

Merged
merged 5 commits into from
Jan 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
6 changes: 1 addition & 5 deletions src/ch04-02-references-and-borrowing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

<!-- This example is being ignored because there's a bug in rustdoc making the
edition2018 not work. The bug is currently fixed in nightly, so when we update
the book to >= 1.35, `ignore` can be removed from this example. -->

```rust,edition2018,ignore
```rust,edition2018
let mut s = String::from("hello");

let r1 = &s; // no problem
Expand Down
9 changes: 1 addition & 8 deletions tools/src/bin/remove_markup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 == "<figure>" ||
line == "<figcaption>" ||
line == "</figcaption>" ||
line == "</figure>"
{
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 {
Expand Down