Using Explicit Types
Setting data types implicitly like this:
let alfa = 7;
or explicitly like this:
let alfa: i32 = 7;
are both frequency occurrences in Rust programs. While the implicit version is shorter to type and easier to read we'll be using the explicit approach for a few reasons:
- To get used to the idea that every value has a type
- To use a consistent format in our examples
- Because you can always use explicit compared to implicit types which only work sometimes.