The Unexpected Joys of Rust
summary
A list-driven overview of surprising but useful Rust features collected from developers’ experiences. Covers concrete items such as Result::from_iter, ubiquitous pattern use (including in function arguments and let bindings), and creating arrays with [CONST; N] even for types that are not Copy.
AI-written summary · about
chapters (25)
- 0:00Rust joys intro
- 1:41Collect beyond vectors
- 3:50Unit types in collects
- 4:59Never type in loops
- 6:26Constant context in Rust
- 8:37Constant functions
- 9:19Transforming Result and Option
- 10:26Items as expressions
- 11:30Anonymous modules in macros
- 13:36Labeled loops
- 14:41Maybe uninitialized variables
- 15:49Returning references from blocks
- 16:52Trait objects for dynamic dispatch
- 18:39Full paths without use
- 19:44Anonymous trait imports
- 20:51Iterator adapter ownership
- 22:37Trait bounds for references
- 23:40Peekable iterators
- 25:28Documenting blocks
- 26:12Trait implementation docs
- 26:53Pattern matching everywhere
- 27:56Repeating array elements
- 30:28Anonymous constants
- 31:33Deferred initialization
- 32:35Pattern matching in function args
