mirror of
https://github.com/rust-lang/book.git
synced 2026-07-16 11:43:01 -04:00
Ch. 17: fix internal links with new ch. order
Note: this does *not* include all fixes for the text, only for the links themselves. For the text, we will also need to search for references to chapters 17-20. This catches a few of those along the way, but there are no doubt others.
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
The 2018 edition of the book is no longer distributed with Rust's documentation.
|
||||
|
||||
If you came here via a link or web search, you may want to check out [the current
|
||||
version of the book](../ch17-03-oo-design-patterns.html) instead.
|
||||
version of the book](../ch18-03-oo-design-patterns.html) instead.
|
||||
|
||||
If you have an internet connection, you can [find a copy distributed with
|
||||
Rust
|
||||
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch17-03-oo-design-patterns.html).
|
||||
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch17-03-oo-design-patterns.html).
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
The second edition of the book is no longer distributed with Rust's documentation.
|
||||
|
||||
If you came here via a link or web search, you may want to check out [the current
|
||||
version of the book](../ch17-03-oo-design-patterns.html) instead.
|
||||
version of the book](../ch18-03-oo-design-patterns.html) instead.
|
||||
|
||||
If you have an internet connection, you can [find a copy distributed with
|
||||
Rust
|
||||
1.30](https://doc.rust-lang.org/1.30.0/book/second-edition/ch17-03-oo-design-patterns.html).
|
||||
1.30](https://doc.rust-lang.org/1.30.0/book/second-edition/ch17-03-oo-design-patterns.html).
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
The second edition of the book is no longer distributed with Rust's documentation.
|
||||
|
||||
If you came here via a link or web search, you may want to check out [the current
|
||||
version of the book](../ch18-00-patterns.html) instead.
|
||||
version of the book](../ch19-00-patterns.html) instead.
|
||||
|
||||
If you have an internet connection, you can [find a copy distributed with
|
||||
Rust
|
||||
1.30](https://doc.rust-lang.org/1.30.0/book/second-edition/ch18-00-patterns.html).
|
||||
1.30](https://doc.rust-lang.org/1.30.0/book/second-edition/ch18-00-patterns.html).
|
||||
|
||||
@@ -184,4 +184,4 @@ ch05-01-defining-structs.html#creating-instances-from-other-instances-with-struc
|
||||
ch04-01-what-is-ownership.html#stack-only-data-copy
|
||||
[ways-variables-and-data-interact-clone]:
|
||||
ch04-01-what-is-ownership.html#ways-variables-and-data-interact-clone
|
||||
[macros]: ch19-06-macros.html#macros
|
||||
[macros]: ch20-06-macros.html#macros
|
||||
|
||||
@@ -250,6 +250,6 @@ But structs aren’t the only way you can create custom types: let’s turn to
|
||||
Rust’s enum feature to add another tool to your toolbox.
|
||||
|
||||
[enums]: ch06-00-enums.html
|
||||
[trait-objects]: ch17-02-trait-objects.md
|
||||
[trait-objects]: ch18-02-trait-objects.md
|
||||
[public]: ch07-03-paths-for-referring-to-an-item-in-the-module-tree.html#exposing-paths-with-the-pub-keyword
|
||||
[modules]: ch07-02-defining-modules-to-control-scope-and-privacy.html
|
||||
|
||||
@@ -246,9 +246,10 @@ that doesn’t match a pattern in an earlier arm, and we don’t want to run any
|
||||
code in this case.
|
||||
|
||||
There’s more about patterns and matching that we’ll cover in [Chapter
|
||||
18][ch18-00-patterns]<!-- ignore -->. For now, we’re going to move on to the
|
||||
19][ch19-00-patterns]<!-- ignore -->. For now, we’re going to move on to the
|
||||
`if let` syntax, which can be useful in situations where the `match` expression
|
||||
is a bit wordy.
|
||||
|
||||
[tuples]: ch03-02-data-types.html#the-tuple-type
|
||||
[ch18-00-patterns]: ch18-00-patterns.html
|
||||
|
||||
[ch19-00-patterns]: ch19-00-patterns.html
|
||||
|
||||
@@ -533,5 +533,5 @@ let’s return to the topic of how to decide which is appropriate to use in whic
|
||||
cases.
|
||||
|
||||
[handle_failure]: ch02-00-guessing-game-tutorial.html#handling-potential-failure-with-result
|
||||
[trait-objects]: ch17-02-trait-objects.html#using-trait-objects-that-allow-for-values-of-different-types
|
||||
[trait-objects]: ch18-02-trait-objects.html#using-trait-objects-that-allow-for-values-of-different-types
|
||||
[termination]: ../std/process/trait.Termination.html
|
||||
|
||||
@@ -219,4 +219,4 @@ Now that you’ve seen useful ways that the standard library uses generics with
|
||||
the `Option` and `Result` enums, we’ll talk about how generics work and how you
|
||||
can use them in your code.
|
||||
|
||||
[encoding]: ch17-03-oo-design-patterns.html#encoding-states-and-behavior-as-types
|
||||
[encoding]: ch18-03-oo-design-patterns.html#encoding-states-and-behavior-as-types
|
||||
|
||||
@@ -385,5 +385,5 @@ that checks for behavior at runtime because we’ve already checked at compile
|
||||
time. Doing so improves performance without having to give up the flexibility
|
||||
of generics.
|
||||
|
||||
[using-trait-objects-that-allow-for-values-of-different-types]: ch17-02-trait-objects.html#using-trait-objects-that-allow-for-values-of-different-types
|
||||
[using-trait-objects-that-allow-for-values-of-different-types]: ch18-02-trait-objects.html#using-trait-objects-that-allow-for-values-of-different-types
|
||||
[methods]: ch05-03-method-syntax.html#defining-methods
|
||||
|
||||
@@ -47,4 +47,4 @@ detail.
|
||||
[ch10]: ch10-00-generics.html
|
||||
[ch11]: ch11-00-testing.html
|
||||
[ch13]: ch13-00-functional-features.html
|
||||
[ch17]: ch17-00-oop.html
|
||||
[ch17]: ch18-00-oop.html
|
||||
|
||||
@@ -491,5 +491,5 @@ write some tests!
|
||||
[ch9-custom-types]: ch09-03-to-panic-or-not-to-panic.html#creating-custom-types-for-validation
|
||||
[ch9-error-guidelines]: ch09-03-to-panic-or-not-to-panic.html#guidelines-for-error-handling
|
||||
[ch9-result]: ch09-02-recoverable-errors-with-result.html
|
||||
[ch17]: ch17-00-oop.html
|
||||
[ch17]: ch18-00-oop.html
|
||||
[ch9-question-mark]: ch09-02-recoverable-errors-with-result.html#a-shortcut-for-propagating-errors-the--operator
|
||||
|
||||
@@ -252,4 +252,4 @@ even more important to the functionality provided by the other smart pointer
|
||||
types we’ll discuss in the rest of this chapter. Let’s explore these two traits
|
||||
in more detail.
|
||||
|
||||
[trait-objects]: ch17-02-trait-objects.html#using-trait-objects-that-allow-for-values-of-different-types
|
||||
[trait-objects]: ch18-02-trait-objects.html#using-trait-objects-that-allow-for-values-of-different-types
|
||||
|
||||
@@ -508,4 +508,4 @@ That is a good note to turn to our final section and wrap up this walk through
|
||||
async in Rust, by discussing how futures (including streams), tasks, and threads
|
||||
relate to each other, and how you can use them together.
|
||||
|
||||
[17-02-messages]: /ch17-02-concurrency-with-async.md#message-passing
|
||||
[17-02-messages]: ch17-02-concurrency-with-async.md#message-passing
|
||||
|
||||
@@ -74,7 +74,7 @@ up correctly.
|
||||
These limitations make threads harder to compose than futures. It is much more
|
||||
difficult, for example, to build something like the `timeout` we built in
|
||||
[“Building Our Own Async Abstractions”][combining-futures], or the `throttle`
|
||||
method we used with streams in [“Working With Streams”][streams]. The fact that
|
||||
method we used with streams in [“Composing Streams”][streams]. The fact that
|
||||
futures are richer data structures means they *can* be composed together more
|
||||
naturally, as we have seen.
|
||||
|
||||
@@ -116,5 +116,5 @@ as your Rust programs get bigger. In addition, we’ll discuss how Rust’s idio
|
||||
relate to those you might be familiar with from object-oriented programming.
|
||||
|
||||
|
||||
[combining-futures]: /ch17-04-more-ways-of-combining-futures.md#building-our-own-async-abstractions
|
||||
[streams]: /ch17-05-streams.md#working-with-streams
|
||||
[combining-futures]: ch17-04-more-ways-of-combining-futures.md#building-our-own-async-abstractions
|
||||
[streams]: ch17-05-streams.md#composing-streams
|
||||
|
||||
@@ -253,4 +253,4 @@ support in Listing 17-9, so it’s a trade-off to consider.
|
||||
|
||||
[performance-of-code-using-generics]:
|
||||
ch10-01-syntax.html#performance-of-code-using-generics
|
||||
[dynamically-sized]: ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait
|
||||
[dynamically-sized]: ch20-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait
|
||||
|
||||
@@ -513,4 +513,4 @@ lots of flexibility. We’ve looked at them briefly throughout the book but
|
||||
haven’t seen their full capability yet. Let’s go!
|
||||
|
||||
[more-info-than-rustc]: ch09-03-to-panic-or-not-to-panic.html#cases-in-which-you-have-more-information-than-the-compiler
|
||||
[macros]: ch19-06-macros.html#macros
|
||||
[macros]: ch20-06-macros.html#macros
|
||||
|
||||
@@ -247,4 +247,4 @@ be irrefutable; in other circumstances, they can be refutable. We’ll discuss
|
||||
these two concepts next.
|
||||
|
||||
[ignoring-values-in-a-pattern]:
|
||||
ch18-03-pattern-syntax.html#ignoring-values-in-a-pattern
|
||||
ch19-03-pattern-syntax.html#ignoring-values-in-a-pattern
|
||||
|
||||
@@ -459,7 +459,7 @@ behavior—we would have to implement just the methods we do want manually.
|
||||
This newtype pattern is also useful even when traits are not involved. Let’s
|
||||
switch focus and look at some advanced ways to interact with Rust’s type system.
|
||||
|
||||
[newtype]: ch19-03-advanced-traits.html#using-the-newtype-pattern-to-implement-external-traits-on-external-types
|
||||
[newtype]: ch20-03-advanced-traits.html#using-the-newtype-pattern-to-implement-external-traits-on-external-types
|
||||
[implementing-a-trait-on-a-type]:
|
||||
ch10-02-traits.html#implementing-a-trait-on-a-type
|
||||
[traits-defining-shared-behavior]:
|
||||
|
||||
@@ -288,10 +288,10 @@ pointer. In this case, we’ve chosen a reference.
|
||||
Next, we’ll talk about functions and closures!
|
||||
|
||||
[encapsulation-that-hides-implementation-details]:
|
||||
ch17-01-what-is-oo.html#encapsulation-that-hides-implementation-details
|
||||
ch18-01-what-is-oo.html#encapsulation-that-hides-implementation-details
|
||||
[string-slices]: ch04-03-slices.html#string-slices
|
||||
[the-match-control-flow-operator]:
|
||||
ch06-02-match.html#the-match-control-flow-operator
|
||||
[using-trait-objects-that-allow-for-values-of-different-types]:
|
||||
ch17-02-trait-objects.html#using-trait-objects-that-allow-for-values-of-different-types
|
||||
[using-the-newtype-pattern]: ch19-03-advanced-traits.html#using-the-newtype-pattern-to-implement-external-traits-on-external-types
|
||||
ch18-02-trait-objects.html#using-trait-objects-that-allow-for-values-of-different-types
|
||||
[using-the-newtype-pattern]: ch20-03-advanced-traits.html#using-the-newtype-pattern-to-implement-external-traits-on-external-types
|
||||
|
||||
@@ -119,12 +119,12 @@ We can use a trait object:
|
||||
This code will compile just fine. For more about trait objects, refer to the
|
||||
section [“Using Trait Objects That Allow for Values of Different
|
||||
Types”][using-trait-objects-that-allow-for-values-of-different-types]<!--
|
||||
ignore --> in Chapter 17.
|
||||
ignore --> in Chapter 18.
|
||||
|
||||
Next, let’s look at macros!
|
||||
|
||||
[advanced-traits]:
|
||||
ch19-03-advanced-traits.html#advanced-traits
|
||||
ch20-03-advanced-traits.html#advanced-traits
|
||||
[enum-values]: ch06-01-defining-an-enum.html#enum-values
|
||||
[using-trait-objects-that-allow-for-values-of-different-types]:
|
||||
ch17-02-trait-objects.html#using-trait-objects-that-allow-for-values-of-different-types
|
||||
ch18-02-trait-objects.html#using-trait-objects-that-allow-for-values-of-different-types
|
||||
|
||||
@@ -690,7 +690,7 @@ the associated block. In Listing 20-21, the lock remains held for the duration
|
||||
of the call to `job()`, meaning other workers cannot receive jobs.
|
||||
|
||||
[creating-type-synonyms-with-type-aliases]:
|
||||
ch19-04-advanced-types.html#creating-type-synonyms-with-type-aliases
|
||||
ch20-04-advanced-types.html#creating-type-synonyms-with-type-aliases
|
||||
[integer-types]: ch03-02-data-types.html#integer-types
|
||||
[fn-traits]:
|
||||
ch13-01-closures.html#moving-captured-values-out-of-the-closure-and-the-fn-traits
|
||||
|
||||
Reference in New Issue
Block a user