Types

We'll cover the following...

We’ve spoken about numbers and strings. In Rust, every value has a type that tells you what kind of thing it is. When you have a string literal (something between double quotes) like "Hello, world!", its type is &str.

When you use let to declare a variable, you can give its type as well, like this:

Press + to interact
fn main() {
let name: &str = "Michael";
println!("My name is {}", name);
}

Rust has something called type inference, which means that in many cases, you can skip putting in the type, and the compiler will ...