TUSST — the Stroop SigilTUSST
journeyforgecampaignadvanced
sign in
‹ advanced path

Collections, Iterators & Closures

Picking the right container on complexity rather than habit, then expressing the transformation lazily. Includes the Fn/FnMut/FnOnce distinction that decides what a closure may capture.

serves: Rust/C++ systems programming7 lessons · ~4h
progress0/7
Start track

// lessons

  1. 01

    Vec, VecDeque & Growth

    Choose between them on push/pop position, and stop reallocating in a hot loop.

  2. 02

    HashMap vs BTreeMap

    Pick on ordering and complexity, not on which one you typed last time.

  3. 03

    iter, iter_mut & into_iter

    Say what each one hands you, and what it does to the collection.

  4. 04

    Adapters & Laziness

    Chain map/filter/filter_map and explain why nothing ran until collect.

  5. 05

    fold, reduce & Custom Aggregation

    Replace a mutable accumulator loop with one expression.

  6. 06

    Fn, FnMut & FnOnce

    Predict which trait a closure implements from what it captures.

  7. 07

    move Closures & Escaping Captures

    Hand a closure to something that outlives its scope, correctly.

Every exercise compiles and runs in the Forge sandbox — standard library only, no external crates.

TUSST · The Ultimate Stellar Supreme Tutorial

learn rust → master stellar · open-source