flâneur — a map of the web's best reading

Expressions - Rust By Example

doc.rust-lang.org · 231 words · saved by 1 readers

Rust by Example (RBE) is a collection of runnable examples that illustrate various Rust concepts and standard libraries.

Expressions - Rust By Example Keyboard shortcuts Press ← or → to navigate between chapters Press S or / to search in the book Press ? to show this help Press Esc to hide this help Auto Light Rust Coal Navy Ayu Rust By Example Expressions A Rust program is (mostly) made up of a series of statements: fn main() { // statement // statement // statement } There are a few kinds of statements in Rust. The most common two are declaring a variable binding, and using a ; with an expression: fn main() { // variable binding let x = 5; // expression; x; x + 1; 15; } Blocks are expressions too, so they can

Explore this link on the map →

related reading