On Friday, 19 February 2016 at 12:28:14 UTC, Nemanja Boric wrote:
What Rust is doing:

```
let foo: Option<i32> = bar();

let new_stuff = match foo {
   Some(x) => x,
   None => 0
}
```

(or similar, I don't have compiler handy).

I think most would write that as:

    let new_stuf = bar().unwrap_or(0);

When you use the methods on `Option` you rarely need to match.

Reply via email to