Auto merge of #26513 - shunyata:master, r=alexcrichton
I'm currently reading the rust book and this variable name tripped me up. Because it was called "input", I thought at first it might contain the line read by read_line(). This new variable name will be more instructive to rust beginners.
This commit is contained in:
commit
17450192d9
1 changed files with 3 additions and 3 deletions
|
@ -225,7 +225,7 @@ There's another way of doing this that's a bit nicer than `unwrap()`:
|
|||
|
||||
```rust,ignore
|
||||
let mut buffer = String::new();
|
||||
let input = io::stdin().read_line(&mut buffer)
|
||||
let num_bytes_read = io::stdin().read_line(&mut buffer)
|
||||
.ok()
|
||||
.expect("Failed to read line");
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue