Blocks have value
Operator precedence table is in the reference manual. 18 levels. Left associativity. Left-to-right evaluation?
Conversion is mostly explicit through
as. Only conversions that are "safe" work (where safe has a somewhat non-intuitive definition)
Reference magic happens
- Auto dereference in certain situations as discussed earlier
- Auto reference conversions in certain situations, e.g.
Expressions and Control Flow
In Rust, some of what we would normally do with control flow is done with simple expressions. This is part of Rust's functional-language heritage
ifis an expression type
- "method" chaining is a standard mechanism
Many Rust operations are used in an "object-oriented style":
This allows stringing together expressions in more readable syntax (and also facilitates proper borrowing/sharing).
Explicit Control Flow