First thing that I find very odd in @rustlang:
io::stdin().read_line(&mut guess)
.expect("Failed to read line");
This means that if read_line fails, we will print "Failed to read line".
expect is a method on a more gee tic type, result, that read_line returns. It’s not specific to it.
-
-
I got that. I used read_line as an example for a function that can throw an error (working through tutorial). I really think it's a confusing name in general, as I am not expecting what I am passing to the function. As a generic name, I'd prefer e.g. "on_error" for that.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.