Patterns
You might already have seen the use of the let
keyword for declaring variables. Why use that instead of something like var
? Or the type of the variable?
Well, the type is already out because of type inference, as seen in its own chapter. The var
does imply declaring a variable, but let
does a bit more in Rust. It binds a pattern!