Re:Rust const generics MVP hits beta
by NobodyNada on Friday February 26, 2021 @05:51PM
(#26280804)
Swift has had ‘guard’ statements since 2015, and it’s the biggest thing I miss when programming in Rust:
[ Parent
| on HN ]
In Rust I would just do:
let x = match foo {
Some(x) => ...,
None => return // or break, etc.
};
// do something with x
(This is assuming that you don't want to propagate an error or panic, which could be more easily done with `foo?` or `foo.unwrap()` respectively.)