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:

  1. To get used to the idea that every value has a type
  2. To use a consistent format in our examples
  3. Because you can always use explicit compared to implicit types which only work sometimes.