News for hackers. Stuff that matters.
Re:Things Rust shipped without by pcwalton on Friday July 03, 2015 @07:21PM (#9828433)
Usually I would just factor out the guts of the expression into a little closure in that case. (let f = |x| h ^= ... x ...) LLVM should inline it just fine, and it'll save you typing.
Re:Things Rust shipped without by yazaddaruvala on Friday July 03, 2015 @10:38PM (#9828907)
If loops can have specialized control-flow keywords (break; continue), why not let match have one (fallthrough)?

    match x {
        0 => { /* do some stuff */; fall_through; },
        1 => true,
        _ => false
    }
However, I don't know yet how useful it would be. I can't remember ever really needing it, so it would probably need a few practical examples before it became a reality but its an idea.
Re:Things Rust shipped without by pcwalton on Friday July 03, 2015 @10:44PM (#9828922)
If we really need it I'd rather have C#-style goto-label instead of explicit fall-through, which is strictly less general. (But I'd almost rather it be a tail-duplicating macro to begin with, since the feature is so rarely needed.)
Re:Things Rust shipped without by detrino on Friday July 03, 2015 @09:09PM (#9828729)
I don't see how this helps here, unless you intend to call the closure several times per case.