Skip to content

Commit

Permalink
Merge pull request #2575 from VoidNoire/2574
Browse files Browse the repository at this point in the history
Fix issue #2574 - Improve the explanation about the behaviour of `read_line`.
  • Loading branch information
carols10cents committed Feb 12, 2021
2 parents a2168e1 + 9281a28 commit 8a410f4
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 8a410f4

Please sign in to comment.