|
|
any, all, find, position: audit a list of records
|
Easy
|
Primitives
|
|
|
|
Bounds checks: when they cost, and five safe ways to remove them
|
Hard
|
End-to-End
|
|
|
|
Chains versus loops: top-k, and a function that must not allocate
|
Medium
|
End-to-End
|
|
|
|
Closures 101: build a pipeline of boxed closures
|
Easy
|
Primitives
|
|
|
|
collect and the turbofish: three targets, one source
|
Medium
|
Primitives
|
|
|
|
Collecting an iterator of Results
|
Medium
|
Primitives
|
|
|
|
Everything you can collect into
|
Easy
|
Primitives
|
|
|
|
flat_map: expand a range spec like "1-3,7,10-12"
|
Medium
|
End-to-End
|
|
|
|
fold and try_fold: a total that refuses to overflow
|
Medium
|
Primitives
|
|
|
|
from_fn and successors: iterators without writing a struct
|
Easy
|
Primitives
|
|
|
|
Implement Iterator by hand: the Collatz sequence
|
Medium
|
Primitives
|
|
|
|
Indexing in a loop is usually a borrow-checker workaround — and clippy knows
|
Medium
|
Primitives
|
|
|
|
IntoIterator: one bound that accepts five containers
|
Medium
|
Primitives
|
|
|
|
Iterator invalidation, and the bug class that stopped existing
|
Medium
|
Primitives
|
|
|
|
Iterator performance: where the abstraction leaks
|
Medium
|
End-to-End
|
|
|
|
iter, iter_mut, into_iter: all three, one Vec
|
Easy
|
Primitives
|
|
|
|
iter_mut(): mutating every element without ever holding two &mut
|
Medium
|
Primitives
|
|
|
|
Joining owned strings
|
Easy
|
Primitives
|
|
|
|
Laziness: prove the pipeline interleaves
|
Easy
|
Primitives
|
|
|
|
`longest`: writing your first `'a`
|
Medium
|
Primitives
|
|
|
|
loop, while, for, and break with a value
|
Easy
|
Primitives
|
|
|
|
Make the lint happy: `'_` in return paths
|
Easy
|
Primitives
|
|
|
|
Make your own collection iterable, all three ways
|
Hard
|
Framework
|
|
|
|
map, filter, filter_map: parse host:port lines
|
Easy
|
Primitives
|
|
|
|
min and max: the tie-breaking rule nobody reads
|
Medium
|
Primitives
|
|
|
|
Ownership inside loops
|
Medium
|
Primitives
|
|
|
|
partition and unzip: two collections from one pass
|
Medium
|
Primitives
|
|
|
|
peekable and next_if: write a tokeniser
|
Hard
|
End-to-End
|
|
|
|
`PhantomData`, variance and drop-check
|
Hard
|
Framework
|
|
|
|
scan: a running balance that stops at the floor
|
Medium
|
Primitives
|
|
|
|
Set algebra with BTreeSet
|
Easy
|
Primitives
|
|
|
|
size_hint and DoubleEndedIterator: an iterator with two ends
|
Hard
|
Primitives
|
|
|
|
take_while and skip_while: split a message at the blank line
|
Easy
|
Primitives
|
|
|
|
The double-reference wall: &&x, copied and cloned
|
Medium
|
Primitives
|
|
|
|
The FnMut borrow gauntlet: a log you can read afterwards
|
Medium
|
Primitives
|
|
|
|
The Option combinator vocabulary
|
Easy
|
Primitives
|
|
|
|
Vec surgery: retain, dedup and extract_if
|
Medium
|
Primitives
|
|
|
|
windows and chunks are slice methods, not iterator adapters
|
Medium
|
Primitives
|
|
|
|
Write your own adapters, with an extension trait
|
Hard
|
Framework
|
|
|
|
zip and enumerate: pair two lists and report the leftovers
|
Easy
|
Primitives
|
|