3 ms·
> "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,
by klyrs 7y ago
> "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...)
- steveklabnik 7y agoThe 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) =
- klyrs 7y agoYeah, I can live with that.