I’m working through the tutorial and on this line:
io::stdin().read_line(&mut guess) .ok() .expect("Failed to read line");
I’m getting the following error:
error: this function takes 0 parameters but 1 parameter was supplied [E0061]
it’s occurring because I take it that read_line is not supposed to be passed parameters. So when I change it to this:
let input = io::stdin().read_line() .ok() .expect("Failed to read line");
And print the result of input everything works fine. Has there been a change in rust? or is there something I’m missing. Also, if I remove
&mut guess and comment out the let for guess the program compiles and runs perfectly.
Just trying to get a handle on this. Thanks!