diff --git a/src/SUMMARY.md b/src/SUMMARY.md index 7458466818..4ddea01d4f 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -125,7 +125,7 @@ - [From Single-Threaded to Multithreaded Server](ch21-02-multithreaded.md) - [Graceful Shutdown and Cleanup](ch21-03-graceful-shutdown-and-cleanup.md) -- [Appendix](appendix-00.md) +- [Appendices](appendix-00.md) - [A - Keywords](appendix-01-keywords.md) - [B - Operators and Symbols](appendix-02-operators.md) - [C - Derivable Traits](appendix-03-derivable-traits.md) diff --git a/src/appendix-03-derivable-traits.md b/src/appendix-03-derivable-traits.md index 1bcc1de931..07a68f04ff 100644 --- a/src/appendix-03-derivable-traits.md +++ b/src/appendix-03-derivable-traits.md @@ -130,10 +130,10 @@ the stack; no arbitrary code is necessary. See the [“Stack-Only Data: Copy”][stack-only-data-copy] section in Chapter 4 for more information on `Copy`. -The `Copy` trait doesn’t define any methods to prevent programmers from -overloading those methods and violating the assumption that no arbitrary code -is being run. That way, all programmers can assume that copying a value will be -very fast. +The `Copy` trait doesn’t define, on purpose, any methods to prevent programmers +from overloading those methods and violating the assumption that no arbitrary +code is being run. That way, all programmers can assume that copying a value +will be very fast. You can derive `Copy` on any type whose parts all implement `Copy`. A type that implements `Copy` must also implement `Clone` because a type that implements diff --git a/src/ch00-00-introduction.md b/src/ch00-00-introduction.md index 4dfa272fcc..99516dc6de 100644 --- a/src/ch00-00-introduction.md +++ b/src/ch00-00-introduction.md @@ -187,7 +187,7 @@ meant to work: | Ferris | Meaning | | ---------------------------------------------------------------------------------------------------------------- | ------------------------------------------------ | | Ferris with a question mark | This code does not compile! | -| Ferris throwing up their hands | This code panics! | +| Ferris throwing up its hands | This code panics! | | Ferris with one claw up, shrugging | This code does not produce the desired behavior. | In most situations, we’ll lead you to the correct version of any code that diff --git a/src/ch01-00-getting-started.md b/src/ch01-00-getting-started.md index ccb10e884e..364befe882 100644 --- a/src/ch01-00-getting-started.md +++ b/src/ch01-00-getting-started.md @@ -3,6 +3,6 @@ Let’s start your Rust journey! There’s a lot to learn, but every journey starts somewhere. In this chapter, we’ll discuss: -- Installing Rust on Linux, macOS, and Windows +- Installing Rust on GNU/Linux, macOS, and Windows - Writing a program that prints `Hello, world!` - Using `cargo`, Rust’s package manager and build system diff --git a/src/ch01-01-installation.md b/src/ch01-01-installation.md index a9e03f534a..e5cec4c4e2 100644 --- a/src/ch01-01-installation.md +++ b/src/ch01-01-installation.md @@ -23,9 +23,10 @@ these steps should work as expected with the content of this book. > show the output of the previous command. Additionally, PowerShell-specific > examples will use `>` rather than `$`. -### Installing `rustup` on Linux or macOS +### Installing `rustup` on GNU/Linux or macOS -If you’re using Linux or macOS, open a terminal and enter the following command: +If you’re using GNU/Linux or macOS, open a terminal and enter the following +command: ```console $ curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh @@ -51,7 +52,7 @@ On macOS, you can get a C compiler by running: $ xcode-select --install ``` -Linux users should generally install GCC or Clang, according to their +GNU/Linux users should generally install GCC or Clang, according to their distribution’s documentation. For example, if you use Ubuntu, you can install the `build-essential` package. @@ -100,7 +101,7 @@ In PowerShell, use: > echo $env:Path ``` -In Linux and macOS, use: +In GNU/Linux and macOS, use: ```console $ echo $PATH diff --git a/src/ch01-02-hello-world.md b/src/ch01-02-hello-world.md index a70b2db6d3..e89908260d 100644 --- a/src/ch01-02-hello-world.md +++ b/src/ch01-02-hello-world.md @@ -25,7 +25,7 @@ your projects there. Open a terminal and enter the following commands to make a _projects_ directory and a directory for the “Hello, world!” project within the _projects_ directory. -For Linux, macOS, and PowerShell on Windows, enter this: +For GNU/Linux, macOS, and PowerShell on Windows, enter this: ```console $ mkdir ~/projects @@ -66,7 +66,7 @@ fn main() { Save the file and go back to your terminal window in the -_~/projects/hello_world_ directory. On Linux or macOS, enter the following +_~/projects/hello_world_ directory. On GNU/Linux or macOS, enter the following commands to compile and run the file: ```console @@ -75,11 +75,11 @@ $ ./main Hello, world! ``` -On Windows, enter the command `.\main` instead of `./main`: +On Windows, enter the command `.\main.exe` instead of `./main`: ```powershell > rustc main.rs -> .\main +> .\main.exe Hello, world! ``` @@ -164,7 +164,7 @@ $ rustc main.rs If you have a C or C++ background, you’ll notice that this is similar to `gcc` or `clang`. After compiling successfully, Rust outputs a binary executable. -On Linux, macOS, and PowerShell on Windows, you can see the executable by +On GNU/Linux, macOS, and PowerShell on Windows, you can see the executable by entering the `ls` command in your shell: ```console @@ -172,7 +172,7 @@ $ ls main main.rs ``` -On Linux and macOS, you’ll see two files. With PowerShell on Windows, you’ll +On GNU/Linux and macOS, you’ll see two files. With PowerShell on Windows, you’ll see the same three files that you would see using CMD. With CMD on Windows, you would enter the following: @@ -189,7 +189,7 @@ Windows, a file containing debugging information with the _.pdb_ extension. From here, you run the _main_ or _main.exe_ file, like this: ```console -$ ./main # or .\main on Windows +$ ./main # or .\main.exe on Windows ``` If your _main.rs_ is your “Hello, world!” program, this line prints `Hello, diff --git a/src/ch01-03-hello-cargo.md b/src/ch01-03-hello-cargo.md index 70898e1180..a31aad8eb6 100644 --- a/src/ch01-03-hello-cargo.md +++ b/src/ch01-03-hello-cargo.md @@ -201,7 +201,7 @@ Let’s recap what we’ve learned so far about Cargo: An additional advantage of using Cargo is that the commands are the same no matter which operating system you’re working on. So, at this point, we’ll no -longer provide specific instructions for Linux and macOS versus Windows. +longer provide specific instructions for GNU/Linux and macOS versus Windows. ### Building for Release diff --git a/src/ch16-04-extensible-concurrency-sync-and-send.md b/src/ch16-04-extensible-concurrency-sync-and-send.md index a866b6174f..c8fc043d89 100644 --- a/src/ch16-04-extensible-concurrency-sync-and-send.md +++ b/src/ch16-04-extensible-concurrency-sync-and-send.md @@ -78,9 +78,9 @@ uphold them. ## Summary This isn’t the last you’ll see of concurrency in this book: The next chapter -focuses on async programming, and the project in Chapter 21 will use the -concepts in this chapter in a more realistic situation than the smaller -examples discussed here. +focuses on async programming, and the project in Chapter 21 will use these +concepts in a more realistic situation than the smaller examples discussed +here. As mentioned earlier, because very little of how Rust handles concurrency is part of the language, many concurrency solutions are implemented as crates. diff --git a/src/ch17-00-async-await.md b/src/ch17-00-async-await.md index 8564b1e41d..d238b3b48b 100644 --- a/src/ch17-00-async-await.md +++ b/src/ch17-00-async-await.md @@ -137,7 +137,7 @@ series, one task after the other, as in Figure 17-3. A diagram with stacked boxes labeled Task A and Task B, with diamonds in them representing subtasks. In Task A, arrows point from A1 to A2, from A2 to a pair of thick vertical lines like a “pause” symbol, and from that symbol to A3. In task B, arrows point from B1 to B2, from B2 to B3, from B3 to A3, and from B3 to B4. -
Figure 17-3: A partially parallel workflow, where work happens on Task A and Task B independently until Task A3 is blocked on the results of Task B3.
+
Figure 17-3: A partially parallel workflow, where work proceeds independently on Task A and Task B until Task A3 must wait for the results of Task B3
diff --git a/src/ch17-05-traits-for-async.md b/src/ch17-05-traits-for-async.md index 7f2b66bd4d..77ecb5fab6 100644 --- a/src/ch17-05-traits-for-async.md +++ b/src/ch17-05-traits-for-async.md @@ -536,7 +536,7 @@ fit together! [ch-18]: ch18-00-oop.html [async-book]: https://rust-lang.github.io/async-book/ [under-the-hood]: https://rust-lang.github.io/async-book/02_execution/01_chapter.html -[pinning]: https://rust-lang.github.io/async-book/04_pinning/01_chapter.html +[pinning]: https://rust-lang.github.io/async-book/part-reference/pinning.html [first-async]: ch17-01-futures-and-syntax.html#our-first-async-program [any-number-futures]: ch17-03-more-futures.html#working-with-any-number-of-futures [streams]: ch17-04-streams.html diff --git a/src/ch21-02-multithreaded.md b/src/ch21-02-multithreaded.md index c13249556d..fceefeb082 100644 --- a/src/ch21-02-multithreaded.md +++ b/src/ch21-02-multithreaded.md @@ -46,7 +46,8 @@ You can see how primitive our server is: Real libraries would handle the recognition of multiple requests in a much less verbose way! Start the server using `cargo run`. Then, open two browser windows: one for -_http://127.0.0.1:7878_ and the other for _http://127.0.0.1:7878/sleep_. If you +[_http://127.0.0.1:7878_](http://127.0.0.1:7878) and the other for +[_http://127.0.0.1:7878/sleep_](http://127.0.0.1:7878/sleep). If you enter the _/_ URI a few times, as before, you’ll see it respond quickly. But if you enter _/sleep_ and then load _/_, you’ll see that _/_ waits until `sleep` has slept for its full five seconds before loading.