about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJake Hickey <empty@cqdr.es>2015-06-22 18:38:19 -0400
committerJake Hickey <empty@cqdr.es>2015-06-22 18:48:50 -0400
commitdeee2680155a2b5c36d61fedb28d3aaf4ec1da40 (patch)
treea2a2b0d28efbdf57152c65868fad0c1aebcb8ea2
parent5c5753e876a437bb779e031e1a2c5dff59323028 (diff)
downloadrust-deee2680155a2b5c36d61fedb28d3aaf4ec1da40.tar.gz
rust-deee2680155a2b5c36d61fedb28d3aaf4ec1da40.zip
Use a more descriptive variable name.
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.
-rw-r--r--src/doc/trpl/error-handling.md6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/doc/trpl/error-handling.md b/src/doc/trpl/error-handling.md
index 2a0e8ed1643..580eaa6ca55 100644
--- a/src/doc/trpl/error-handling.md
+++ b/src/doc/trpl/error-handling.md
@@ -225,9 +225,9 @@ 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)
-                       .ok()
-                       .expect("Failed to read line");
+let num_bytes_read = io::stdin().read_line(&mut buffer)
+                                .ok()
+                                .expect("Failed to read line");
 ```
 
 `ok()` converts the `Result` into an `Option`, and `expect()` does the same