Skip to content

Commit

Permalink
Highlight recommended path and lowlight the rest
Browse files Browse the repository at this point in the history
Instead of placing the link to the recommended resource i.e. the second
edition in second place, push it up to the top of the list. In fact,
push the link to the first edition always at the bottom.

To emphasise even more that's where new visitors should go, bolden the
first link, and make the first-ed link smaller.

All this as well as a slight edit and simplification of the copy is
designed to make the new and recommended resources the primary path
readers take, without hiding the old resource completely.
  • Loading branch information
passcod committed Dec 31, 2017
1 parent 6454576 commit 0ed0eef
Show file tree
Hide file tree
Showing 57 changed files with 234 additions and 362 deletions.
10 changes: 4 additions & 6 deletions redirects/associated-types.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% Associated Types

There is a new edition of the book and this is an old link.
<small>There is a new edition of the book and this is an old link.</small>

> Associated types are a way of associating a type placeholder with a trait such that the trait method definitions can use these placeholder types in their signatures.
Expand All @@ -13,12 +13,10 @@ pub trait Iterator {

---

You can [continue to the exact older page][1].
If you're trying to learn Rust, checking out [the second edition][2] might be a better choice.
Here are the relevant sections in the new and old books:

* [In the first edition: Ch 3.30 — Associated Types][1]

* [In the second edition: Ch 19.03 — Advanced Traits][2]
* **[In the second edition: Ch 19.03 — Advanced Traits][2]**
* <small>[In the first edition: Ch 3.30 — Associated Types][1]</small>


[1]: first-edition/associated-types.html
Expand Down
12 changes: 4 additions & 8 deletions redirects/attributes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% Attributes

There is a new edition of the book and this is an old link.
<small>There is a new edition of the book and this is an old link.</small>

> Any item declaration may have an attribute applied to it.
Expand All @@ -14,14 +14,10 @@ fn test_foo() {

---

You can [continue to the exact older page][1].
Here are the relevant sections in the new and old books:

This particular chapter does not exist in the second edition.
The best place to learn about it is [the Rust Reference][2].

* [In the first edition: Ch 3.27 — Attributes][1]

* [In the Rust Reference: Ch 5.3 — Attributes][2]
* **[In the Rust Reference: Ch 5.3 — Attributes][2]**
* <small>[In the first edition: Ch 3.27 — Attributes][1]</small>


[1]: first-edition/attributes.html
Expand Down
7 changes: 3 additions & 4 deletions redirects/bibliography.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
% Bibliography

There is a new edition of the book and this is an old link.
You can [continue to the exact older page][1].
<small>There is a new edition of the book and this is an old link.</small>

This page does not exist in [the second edition][2].
You might be interested in a similar page in [the Rust Reference][3].

* [In the first edition: Section 7 — Bibliography][1]
* **[In the Rust Reference: Appendix — Influences][3]**
* <small>[In the first edition: Section 7 — Bibliography][1]</small>

* [In the Rust Reference: Appendix — Influences][3]

[1]: first-edition/bibliography.html
[2]: second-edition/index.html
Expand Down
9 changes: 3 additions & 6 deletions redirects/borrow-and-asref.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% Borrow and AsRef

There is a new edition of the book and this is an old link.
<small>There is a new edition of the book and this is an old link.</small>

> A cheap reference-to-reference conversion.
> Used to convert a value to a reference value within generic code.
Expand All @@ -13,14 +13,11 @@ fn is_hello<T: AsRef<str>>(s: T) {

---

You can [continue to the exact older page][1].

This chapter does not exist in [the second edition][2].
The best place to learn more about this is [the Rust documentation][3].

* [In the first edition: Ch 4.10 — Borrow and AsRef][1]

* [In the Rust documentation: `convert::AsRef`][3]
* **[In the Rust documentation: `convert::AsRef`][3]**
* <small>[In the first edition: Ch 4.10 — Borrow and AsRef][1]</small>


[1]: first-edition/borrow-and-asref.html
Expand Down
13 changes: 5 additions & 8 deletions redirects/casting-between-types.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% Casting between types

There is a new edition of the book and this is an old link.
<small>There is a new edition of the book and this is an old link.</small>

> A type cast expression is denoted with the binary operator `as`.
> Executing an `as` expression casts the value on the left-hand side to the type on the right-hand side.
Expand All @@ -18,16 +18,13 @@ fn average(values: &[f64]) -> f64 {

---

You can [continue to the exact older page][1].
If you're trying to learn Rust, checking out [the second edition][2] might be a better choice.

* [In the first edition: Ch 3.29 — Casting between types][1]

* [In the second edition: Appendix B — Operators][2]
Here are the relevant sections in the new and old books:

* **[In the second edition: Appendix B — Operators, section Type Cast Expressions][2]**
* [In the Rust Reference: Type Cast Expressions][3]

* [In the Rust documentation: `mem::transmute`][4]
* <small>[In the first edition: Ch 3.29 — Casting between types][1]</small>


[1]: first-edition/casting-between-types.html
[2]: second-edition/appendix-02-operators.html#type-cast-expressions
Expand Down
10 changes: 4 additions & 6 deletions redirects/choosing-your-guarantees.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% Choosing your Guarantees

There is a new edition of the book and this is an old link.
<small>There is a new edition of the book and this is an old link.</small>

> Smart pointers are data structures that act like a pointer, but they also have additional metadata and capabilities.
> The different smart pointers defined in Rust’s standard library provide extra functionality beyond what references provide.
Expand All @@ -12,12 +12,10 @@ println!("b = {}", b);

---

You can [continue to the exact older page][1].
If you're trying to learn Rust, checking out [the second edition][2] might be a better choice.
Here are the relevant sections in the new and old books:

* [In the first edition: Ch 4.8 — Choosing your Guarantees][1]

* [In the second edition: Ch 15.00 — Smart Pointers][2]
* **[In the second edition: Ch 15.00 — Smart Pointers][2]**
* <small>[In the first edition: Ch 4.8 — Choosing your Guarantees][1]</small>


[1]: first-edition/choosing-your-guarantees.html
Expand Down
10 changes: 4 additions & 6 deletions redirects/closures.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% Closures

There is a new edition of the book and this is an old link.
<small>There is a new edition of the book and this is an old link.</small>

> Anonymous functions you can save in a variable or pass as arguments to other functions.
Expand All @@ -18,12 +18,10 @@ let expensive_closure = |num| {

---

You can [continue to the exact older page][1].
If you're trying to learn Rust, checking out [the second edition][2] might be a better choice.
Here are the relevant sections in the new and old books:

* [In the first edition: Ch 3.23 — Closures][1]

* [In the second edition: Ch 13.01 — Closures][2]
* **[In the second edition: Ch 13.01 — Closures][2]**
* <small>[In the first edition: Ch 3.23 — Closures][1]</small>


[1]: first-edition/closures.html
Expand Down
10 changes: 4 additions & 6 deletions redirects/comments.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% Comments

There is a new edition of the book and this is an old link.
<small>There is a new edition of the book and this is an old link.</small>

> Comments must start with two slashes and continue until the end of the line.
> For comments that extend beyond a single line, you’ll need to include // on each line.
Expand All @@ -13,12 +13,10 @@ There is a new edition of the book and this is an old link.

---

You can [continue to the exact older page][1].
If you're trying to learn Rust, checking out [the second edition][2] might be a better choice.
Here are the relevant sections in the new and old books:

* [In the first edition: Ch 3.4 — Comments][1]

* [In the second edition: Ch 3.04 — Comments][2]
* **[In the second edition: Ch 3.04 — Comments][2]**
* <small>[In the first edition: Ch 3.4 — Comments][1]</small>


[1]: first-edition/comments.html
Expand Down
11 changes: 6 additions & 5 deletions redirects/compiler-plugins.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
% Compiler Plugins

There is a new edition of the book and this is an old link.
<small>There is a new edition of the book and this is an old link.</small>

> Compiler plugins are user-provided libraries that extend the compiler's behavior with new syntax extensions, lint checks, etc.
---

You can [continue to the exact older page][1].
This particular chapter has moved to [the Unstable Book][2].

* **[In the Unstable Rust Book: `plugin`][2]**
* <small><del>[In the first edition: Compiler Plugins][1]</del> (does not exist anymore)</small>

This particular chapter has moved to [a chapter in the Unstable
Book][unstable book plugins]. Please check it out there.

[1]: first-edition/compiler-plugins.html
[unstable book plugins]: ../unstable-book/language-features/plugin.html
[2]: ../unstable-book/language-features/plugin.html
10 changes: 4 additions & 6 deletions redirects/concurrency.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
% Concurrency

There is a new edition of the book and this is an old link.
<small>There is a new edition of the book and this is an old link.</small>

> Historically, programming [concurrency] has been difficult and error prone: Rust hopes to change that.
> Fearless concurrency allows you to write code that’s free of subtle bugs and is easy to refactor without introducing new bugs.
---

You can [continue to the exact older page][1].
If you're trying to learn Rust, checking out [the second edition][2] might be a better choice.
Here are the relevant sections in the new and old books:

* [In the first edition: Ch 4.6 — Concurrency][1]

* [In the second edition: Ch 16.00 — Fearless Concurrency][2]
* **[In the second edition: Ch 16.00 — Fearless Concurrency][2]**
* <small>[In the first edition: Ch 4.6 — Concurrency][1]</small>


[1]: first-edition/concurrency.html
Expand Down
16 changes: 7 additions & 9 deletions redirects/conditional-compilation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% Conditional Compilation

There is a new edition of the book and this is an old link.
<small>There is a new edition of the book and this is an old link.</small>

> Sometimes one wants to have different compiler outputs from the same code, depending on build target, such as targeted operating system, or to enable release builds.
> Configuration options are either provided by the compiler or passed in on the command line using.
Expand All @@ -16,15 +16,13 @@ fn macos_only() {

---

You can [continue to the exact older page][1].
This particular chapter does not exist in [the second edition][2].
The best place to learn about it is [the Rust Reference][3].

This particular chapter does not exist in the second edition.
The best place to learn about it is [the Rust Reference][2].

* [In the first edition: Ch 4.3 — Conditional Compilation][1]

* [In the Rust Reference: Ch 5.3 — Attributes, Conditional Compilation section][2]
* **[In the Rust Reference: Ch 5.3 — Attributes, Conditional Compilation section][3]**
* <small>[In the first edition: Ch 4.3 — Conditional Compilation][1]</small>


[1]: first-edition/conditional-compilation.html
[2]: ../reference/attributes.html#conditional-compilation
[2]: second-edition/
[3]: ../reference/attributes.html#conditional-compilation
13 changes: 5 additions & 8 deletions redirects/const-and-static.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% `const` and `static`

There is a new edition of the book and this is an old link.
<small>There is a new edition of the book and this is an old link.</small>

> Constants are _always_ immutable, and may only be set to a constant expression, not the result of a function call or any other value that could only be computed at runtime.
>
Expand All @@ -13,14 +13,11 @@ static HELLO_WORLD: &str = "Hello, world!";

---

You can [continue to the exact older page][1].
If you're trying to learn Rust, checking out [the second edition][2] might be a better choice.
Here are the relevant sections in the new and old books:

* [In the first edition: Ch 3.26 — `const` and `static`][1]

* [In the second edition: Ch 3.01 — Variables and Mutability, section Constants][2]

* [In the second edition: Ch 19.01 — Unsafe Rust, section Static Variables][3]
* **[In the second edition: Ch 3.01 — Variables and Mutability, section Constants][2]**
* **[In the second edition: Ch 19.01 — Unsafe Rust, section Static Variables][3]**
* <small>[In the first edition: Ch 3.26 — `const` and `static`][1]</small>


[1]: first-edition/const-and-static.html
Expand Down
11 changes: 4 additions & 7 deletions redirects/crates-and-modules.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% Crates and Modules

There is a new edition of the book and this is an old link.
<small>There is a new edition of the book and this is an old link.</small>

> Rust has a module system that enables the reuse of code in an organized fashion.
> A module is a namespace that contains definitions of functions or types, and you can choose whether those definitions are visible outside their module (public) or not (private).
Expand All @@ -16,14 +16,11 @@ mod network {

---

You can [continue to the exact older page][1].
If you're trying to learn Rust, checking out [the second edition][2] might be a better choice.

* [In the first edition: Ch 3.25 — Crates and Modules][1]

* [In the second edition: Ch 7.01 — `mod` and the Filesystem][2]
Here are the relevant sections in the new and old books:

* **[In the second edition: Ch 7.01 — `mod` and the Filesystem][2]**
* [In the second edition: Ch 14.02 — Publishing a Crate to Crates.io][2]
* <small>[In the first edition: Ch 3.25 — Crates and Modules][1]</small>


[1]: first-edition/crates-and-modules.html
Expand Down
10 changes: 4 additions & 6 deletions redirects/deref-coercions.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% Deref coercions

There is a new edition of the book and this is an old link.
<small>There is a new edition of the book and this is an old link.</small>

> Implementing the `Deref` trait allows us to customize the behavior of the _dereference operator_ `*`.
> By implementing `Deref` in such a way that a smart pointer can be treated like a regular reference, we can write code that operates on references and use that code with smart pointers too.
Expand All @@ -20,12 +20,10 @@ impl<T> Deref for MyBox<T> {

---

You can [continue to the exact older page][1].
If you're trying to learn Rust, checking out [the second edition][2] might be a better choice.
Here are the relevant sections in the new and old books:

* [In the first edition: Ch 3.33 — Deref coercions][1]

* [In the second edition: Ch 15.02 — Treating Smart Pointers like Regular References with the `Deref` Trait][2]
* **[In the second edition: Ch 15.02 — Treating Smart Pointers like Regular References with the `Deref` Trait][2]**
* <small>[In the first edition: Ch 3.33 — Deref coercions][1]</small>


[1]: first-edition/deref-coercions.html
Expand Down
10 changes: 4 additions & 6 deletions redirects/documentation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% Documentation

There is a new edition of the book and this is an old link.
<small>There is a new edition of the book and this is an old link.</small>

> Documentation comments use `///` instead of `//` and support Markdown notation for formatting the text if you’d like.
> You place documentation comments just before the item they are documenting.
Expand All @@ -22,12 +22,10 @@ pub fn add_one(x: i32) -> i32 {

---

You can [continue to the exact older page][1].
If you're trying to learn Rust, checking out [the second edition][2] might be a better choice.
Here are the relevant sections in the new and old books:

* [In the first edition: Ch 4.4 — Documentation][1]

* [In the second edition: Ch 14.02 — Publishing to crates.io, section Making useful documentation][2]
* **[In the second edition: Ch 14.02 — Publishing to crates.io, section Making useful documentation][2]**
* <small>[In the first edition: Ch 4.4 — Documentation][1]</small>


[1]: first-edition/documentation.html
Expand Down
10 changes: 4 additions & 6 deletions redirects/drop.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% Drop

There is a new edition of the book and this is an old link.
<small>There is a new edition of the book and this is an old link.</small>

> `Drop` lets us customize what happens when a value is about to go out of scope.
Expand All @@ -24,12 +24,10 @@ fn main() {

---

You can [continue to the exact older page][1].
If you're trying to learn Rust, checking out [the second edition][2] might be a better choice.
Here are the relevant sections in the new and old books:

* [In the first edition: Ch 3.20 — Drop][1]

* [In the second edition: Ch 15.03 — The `Drop` Trait Runs Code on Cleanup][2]
* **[In the second edition: Ch 15.03 — The `Drop` Trait Runs Code on Cleanup][2]**
* <small>[In the first edition: Ch 3.20 — Drop][1]</small>


[1]: first-edition/drop.html
Expand Down
Loading

0 comments on commit 0ed0eef

Please sign in to comment.