Reading The Rust Book from cover to cover — Day 3 — Scalar Data Types

Jaspreet Kaur
3 min readApr 8, 2024
Rust Logo

Data Types in Rust

Rust is a strongly typed language so it must know the data type of all variables at compile type. The Rust compiler can usually infer the variable type from the value but in cases where it can’t, a type annotation should be added otherwise “type annotations needed” compile error will be thrown. Example syntax:

--

--