You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just found the Learn chapter has appeared in nightlies.
While working through it the very first bit of code it gets me to run has a bug!
It is
use std::io;
fn main() {
println!("Guess the number!");
println!("Please input your guess.");
let mut guess = String::new();
let input = io::stdin().read_line(&mut guess)
.ok()
.expect("Failed to read line");
println!("You guessed: {}", input);
}
note the last line we are printing input which is there return value of read_line (appears to be number of bytes read) and not the actual string guess which is what the chapter text implies.
Trivial fix...
Took me a while to find, but I figured out where the book source is and will submit PR despite it being one word change so far ;).
The text was updated successfully, but these errors were encountered:
Just found the Learn chapter has appeared in nightlies.
While working through it the very first bit of code it gets me to run has a bug!
It is
note the last line we are printing
input
which is there return value of read_line (appears to be number of bytes read) and not the actual stringguess
which is what the chapter text implies.Trivial fix...
Took me a while to find, but I figured out where the book source is and will submit PR despite it being one word change so far ;).
The text was updated successfully, but these errors were encountered: