Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> "name: type" not "type name", which adds a single :

Sorry for asking a newbie question that's a quick search away, but is there an equivalent to "type name, name, name..."? (I'm biased towards C myself but contemplating a switch...)



The grammar is

    let PATTERN: TYPE =
Rust’s pattern syntax is richer than just introducing variables. I’m on my phone, so it’s a bit hard to show off all of the things that can be done. In this exact case, though, it usually looks like

    let (x, y, z) =
or with types,

    let (x, y, z): (TYPE, TYPE, TYPE) =


Yeah, I can live with that.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: