Skip to content

Commit

Permalink
Fix issue rust-lang#2574 - Improve the explanation about the behaviou…
Browse files Browse the repository at this point in the history
…r of `read_line`.
  • Loading branch information
nothingnesses authored and joeljpresent committed Apr 13, 2021
1 parent e608063 commit 185f056
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ch02-00-guessing-game-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ guess`.
[read_line]: ../std/io/struct.Stdin.html#method.read_line

The job of `read_line` is to take whatever the user types into standard input
and place that into a string, so it takes that string as an argument. The
string argument needs to be mutable so the method can change the string’s
content by adding the user input.
and append that into a string (without overwriting its contents), so it takes
that string as an argument. The string argument needs to be mutable so the
method can change the string’s content by adding the user input.

The `&` indicates that this argument is a *reference*, which gives you a way to
let multiple parts of your code access one piece of data without needing to
Expand Down

0 comments on commit 185f056

Please sign in to comment.