Rust's Most Subtle Syntax | zk
Published on: 2024-11-02Psst. Hey kid. You wanna write confusing Rust? I’ve got just the thing.Bring us let and constQuick rundown on let and const in Rust:letYou use let to declare a new variable. Wow.let x = 5;
This is in the form let PAT = EXPR;, which makes it a bit more powerful than first seems.// +---- this is a pattern. Same as the things you use in matches.
// |
// vvvvv
let (a, b) = (5, 10);
You can combine this with other parts of Rust to get some seriously convenient stuff.// this...
Read more at zkrising.com