Skip to content

Commit

Permalink
update original
Browse files Browse the repository at this point in the history
  • Loading branch information
funkill committed Mar 28, 2024
1 parent f41e48a commit 2e33fab
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion rustbook-en/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ rust-lang/rust uses in [this file][rust-mdbook]. To get it:
[rust-mdbook]: https://github.com/rust-lang/rust/blob/master/src/tools/rustbook/Cargo.toml

```bash
$ cargo install mdbook --version <version_num>
$ cargo install mdbook --locked --version <version_num>
```

## Building
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$ cargo run the poem.txt
$ cargo run -- the poem.txt
Compiling minigrep v0.1.0 (file:///projects/minigrep)
warning: unused `Result` that must be used
--> src/main.rs:19:5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ fn main() {
let counter = Arc::new(Mutex::new(0));
let mut handles = vec![];

for _ in 0..10 {
for _ in 0..=10 {
let counter = Arc::clone(&counter);
let handle = thread::spawn(move || {
let mut num = counter.lock().unwrap();
Expand Down
2 changes: 1 addition & 1 deletion rustbook-en/src/appendix-02-operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ hierarchy to an item.
|--------|-------------|
| `ident::ident` | Namespace path |
| `::path` | Path relative to the crate root (i.e., an explicitly absolute path) |
| `self::path` | Path relative to the current module (i.e., an explicitly relative path).
| `self::path` | Path relative to the current module (i.e., an explicitly relative path). |
| `super::path` | Path relative to the parent of the current module |
| `type::ident`, `<type as trait>::ident` | Associated constants, functions, and types |
| `<type>::...` | Associated item for a type that cannot be directly named (e.g., `<&T>::...`, `<[T]>::...`, etc.) |
Expand Down
2 changes: 1 addition & 1 deletion rustbook-en/src/appendix-06-translation.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ For resources in languages other than English. Most are still in progress; see
- [Esperanto](https://github.com/psychoslave/Rust-libro)
- [ελληνική](https://github.com/TChatzigiannakis/rust-book-greek)
- [Svenska](https://github.com/sebras/book)
- [Farsi](https://github.com/pomokhtari/rust-book-fa)
- [Farsi](https://github.com/RustFarsi/book)
- [Deutsch](https://github.com/rust-lang-de/rustbook-de)
- [हिंदी](https://github.com/venkatarun95/rust-book-hindi)
- [ไทย](https://github.com/rust-lang-th/book-th)
Expand Down
6 changes: 6 additions & 0 deletions rustbook-en/src/appendix-07-nightly-rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ work as expected, you can report it to the team and get it fixed before the
next stable release happens! Breakage in a beta release is relatively rare, but
`rustc` is still a piece of software, and bugs do exist.

### Maintenance time

The Rust project supports the most recent stable version. When a new stable
version is released, the old version reaches its end of life (EOL). This means
each version is supported for six weeks.

### Unstable Features

There’s one more catch with this release model: unstable features. Rust uses a
Expand Down
2 changes: 1 addition & 1 deletion rustbook-en/src/ch03-05-control-flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ evaluates to `true`, the code runs; otherwise, it exits the loop.

#### Looping Through a Collection with `for`

You can choose to use the `while` construct to loop over the elements of a
You can also use the `while` construct to loop over the elements of a
collection, such as an array. For example, the loop in Listing 3-4 prints each
element in the array `a`.

Expand Down
2 changes: 1 addition & 1 deletion rustbook-en/src/ch04-03-slices.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ a string slice for the type of the `s` parameter</span>

If we have a string slice, we can pass that directly. If we have a `String`, we
can pass a slice of the `String` or a reference to the `String`. This
flexibility takes advantage of *deref coercions*, a feature we will cover in
flexibility takes advantage of *deref coercions*, a feature we will cover in the
[“Implicit Deref Coercions with Functions and
Methods”][deref-coercions]<!--ignore--> section of Chapter 15.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ interested in this topic, see [The Rust API Guidelines][api-guidelines].
> well as a *src/lib.rs* library crate root, and both crates will have the
> package name by default. Typically, packages with this pattern of containing
> both a library and a binary crate will have just enough code in the binary
> crate to start an executable that calls code with the library crate. This
> lets other projects benefit from the most functionality that the package
> crate to start an executable that calls code within the library crate. This
> lets other projects benefit from most of the functionality that the package
> provides, because the library crate’s code can be shared.
>
> The module tree should be defined in *src/lib.rs*. Then, any public items can
Expand Down
2 changes: 1 addition & 1 deletion rustbook-en/src/ch11-01-writing-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ Run the tests again:
```

Our test caught the bug! The `it_adds_two` test failed, and the message tells
us that the assertion that fails was `` assertion failed: `(left == right)` ``
us that the assertion that fails was ``assertion `left == right` failed``
and what the `left` and `right` values are. This message helps us start
debugging: the `left` argument was `4` but the `right` argument, where we had
`add_two(2)`, was `5`. You can imagine that this would be especially helpful
Expand Down
2 changes: 1 addition & 1 deletion rustbook-en/src/ch19-01-unsafe-rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ include the ability to:
* Call an unsafe function or method
* Access or modify a mutable static variable
* Implement an unsafe trait
* Access fields of `union`s
* Access fields of a `union`

It’s important to understand that `unsafe` doesn’t turn off the borrow checker
or disable any other of Rust’s safety checks: if you use a reference in unsafe
Expand Down

0 comments on commit 2e33fab

Please sign in to comment.