News for hackers. Stuff that matters.
Re:Rust const generics MVP hits beta by kibwen on Friday February 26, 2021 @07:05PM (#26281341)
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.)
Re:Rust const generics MVP hits beta by emptysea on Friday February 26, 2021 @07:32PM (#26281500)
A nice quality of the `guard` in swift is that you can chain multiple conditions, which is harder to do in rust (maybe with some macros a la if_chain?)