|
|
Borrowing through Option
|
Medium
|
Primitives
|
|
|
|
Borrow it or own it: your first lifetime decision
|
Easy
|
Primitives
|
|
|
|
Closures hold their borrows
|
Medium
|
Primitives
|
|
|
|
Designing signatures: T, &T, &mut T, impl Into<T>
|
Medium
|
Primitives
|
|
|
|
E0499: cannot borrow as mutable more than once
|
Medium
|
Primitives
|
|
|
|
E0502: cannot borrow as mutable because also borrowed as immutable
|
Easy
|
Primitives
|
|
|
|
Fn, FnMut, FnOnce: the closure hierarchy
|
Medium
|
Primitives
|
|
|
|
How to read a borrow-check diagnostic
|
Easy
|
Primitives
|
|
|
|
Indexing in a loop is usually a borrow-checker workaround — and clippy knows
|
Medium
|
Primitives
|
|
|
|
Interior mutability: moving the check from compile time to run time
|
Medium
|
Primitives
|
|
|
|
Iterator invalidation, and the bug class that stopped existing
|
Medium
|
Primitives
|
|
|
|
iter, iter_mut, into_iter: all three, one Vec
|
Easy
|
Primitives
|
|
|
|
iter_mut(): mutating every element without ever holding two &mut
|
Medium
|
Primitives
|
|
|
|
`longest`: writing your first `'a`
|
Medium
|
Primitives
|
|
|
|
Move or borrow: the two ways to pass a value
|
Easy
|
Primitives
|
|
|
|
&mut: exclusive access, and why `mut` appears twice
|
Easy
|
Primitives
|
|
|
|
Needless clone: the most common review comment in Rust
|
Medium
|
End-to-End
|
|
|
|
NLL Problem Case #3, the entry API, and the limits of today's checker
|
Hard
|
Primitives
|
|
|
|
Non-lexical lifetimes: a borrow ends at its last use
|
Easy
|
Primitives
|
|
|
|
Reborrowing: why &mut sometimes moves and sometimes doesn't
|
Hard
|
Primitives
|
|
|
|
ref, ref mut, and default binding modes in edition 2024
|
Medium
|
Primitives
|
|
|
|
Scoped threads: borrow, do not clone
|
Easy
|
Primitives
|
|
|
|
Set algebra with BTreeSet
|
Easy
|
Primitives
|
|
|
|
Slices are borrows
|
Easy
|
Primitives
|
|
|
|
split_at_mut and the disjointness-proof APIs
|
Medium
|
Primitives
|
|
|
|
Split borrows: the checker reasons about places, not variables
|
Medium
|
Primitives
|
|
|
|
&str not &String, &[T] not &Vec<T> — deref coercion and ptr_arg
|
Easy
|
Primitives
|
|
|
|
The FnMut borrow gauntlet: a log you can read afterwards
|
Medium
|
Primitives
|
|
|
|
The owner is frozen too: E0503, E0505, E0506
|
Medium
|
Primitives
|
|
|
|
Two inputs, one output lifetime
|
Medium
|
Primitives
|
|
|
|
Two-phase borrows: why v.push(v.len()) compiles
|
Hard
|
Primitives
|
|
|
|
What a &mut parameter actually promises
|
Medium
|
Primitives
|
|
|
|
Zero-copy parsing: borrow, don't allocate
|
Medium
|
Primitives
|
|