Note The specifics in this question regarding
read_lineand~strpertain to a pre-1.0 version of Rust. The general concepts
Note The specifics in this answer regarding
read_lineand~strpertain to a pre-1.0 version of Rust. The general concepts aboutunwrapandunwrap_orremain relevant.
Because read_line might fail it returns Option<~str>. To get the value out you can use pattern matching or one of the unwrap methods.
The difference between unwrap and unwrap_or is that unwrap will fail if there is no value (None) but unwrap_or will return the specified default ("nothing" in this case)