• soc@programming.dev
    link
    fedilink
    English
    arrow-up
    0
    ·
    1 year ago

    I went the “only let introduces bindings” route, and I’m pretty happy so far:

    if (left.next(), right.next())
    ... is (Some(let l), Some(let r)) { /* use l and r */ }
    ... is (Some(let l), None       ) { /* use l       */ }
    ... is (None,        Some(let r)) { /* use r       */ }
    ... is (None,        None       ) { /* use nothing */ }
    }