2 ms·
`.unwrap()` is used in these examples to avoid having to include code to handle errors. I'd much rather see `.unwrap()` then NullPointerException popping up whe
by hoverbear 12y ago
`.unwrap()` is used in these examples to avoid having to include code to handle errors. I'd much rather see `.unwrap()` then NullPointerException popping up whereever.
In "real" Rust code we have several ways of dealing with possible errors and "None" results.
`.to_string()` tells the compiler to use a `String` which owns it's memory instead of a `&str` which is doesn't own it's...
Oh wait, reading your comment you're trolling.