The Struct Type
How to define, instantiate, and use structs in Rust, including update syntax, field init shorthand, and tuple structs.
Posts, notes, and digests — building the things, mostly in Rust
How to define, instantiate, and use structs in Rust, including update syntax, field init shorthand, and tuple structs.
Build a small Rust program that takes user input from the terminal and constructs a greeting, using functions for separation of concerns.
Rust's three loop types: loop, while, and for, including returning values from loops and using ranges.
Using if, else, and else if expressions in Rust to control program flow, including conditional variable assignment.
Declaring functions in Rust, with parameters, return values, and the difference between statements and expressions.
How to create and access tuples and arrays in Rust, with indexing, destructuring, and when to use each.
Rust's scalar types: integers, floating-point numbers, booleans, and characters.
How variables work in Rust, why they're immutable by default, and how shadowing lets you transform values.
How to declare and use constants in Rust to replace magic values in your code.
How to use regular comments and documentation comments in Rust, and why commenting your code matters.