X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=src%2Fdoc%2Fbook%2Fsrc%2Fch02-00-guessing-game-tutorial.md;h=7ac6d3da830d597d74d641f504c9a5c20446a8ac;hb=532ac7d7530943571f2cb2e5c624518527c627b4;hp=897d0c8d0572b3d57a19a43a3d452081358f20e0;hpb=9fa01778470c44d2c7fe4db4314b79f283b69230;p=rustc.git diff --git a/src/doc/book/src/ch02-00-guessing-game-tutorial.md b/src/doc/book/src/ch02-00-guessing-game-tutorial.md index 897d0c8d05..7ac6d3da83 100644 --- a/src/doc/book/src/ch02-00-guessing-game-tutorial.md +++ b/src/doc/book/src/ch02-00-guessing-game-tutorial.md @@ -171,7 +171,7 @@ let mut bar = 5; // mutable > line. Rust ignores everything in comments, which are discussed in more detail > in Chapter 3. -Let's return to the guessing game program. You now know that `let mut guess` +Let’s return to the guessing game program. You now know that `let mut guess` will introduce a mutable variable named `guess`. On the other side of the equal sign (`=`) is the value that `guess` is bound to, which is the result of calling `String::new`, a function that returns a new instance of a `String`. @@ -193,8 +193,8 @@ To summarize, the `let mut guess = String::new();` line has created a mutable variable that is currently bound to a new, empty instance of a `String`. Whew! Recall that we included the input/output functionality from the standard -library with `use std::io;` on the first line of the program. Now we’ll call an -associated function, `stdin`, on `io`: +library with `use std::io;` on the first line of the program. Now we’ll call +the `stdin` function from the `io` module: ```rust,ignore io::stdin().read_line(&mut guess) @@ -822,7 +822,7 @@ and run the program again. Notice that there is a new problem because the program is doing exactly what we told it to do: ask for another guess forever! It doesn’t seem like the user can quit! -The user could always halt the program by using the keyboard shortcut ctrl-c. But there’s another way to escape this insatiable monster, as mentioned in the `parse` discussion in [“Comparing the Guess to the Secret Number”](#comparing-the-guess-to-the-secret-number)