When to be explicit with type annotation?

Viewed 2947

I've been reading through The Rust Programming Language, but I've been unable to find a clear answer on what the best practice is for type annotation, specifically with primitive types.

For example, letting the compiler determine the type:

let v = true;

Or, using explicit type annotation:

let v: bool = true;

In general I like to be explicit, but I am unsure if this is against best practices or the preferred style. Would compile times be improved due to the compiler not having to infer the type?

1 Answers
Related