PREDICT → OBSERVE → EXPLAIN
What changes on the next line?
Predict first. Run the diagram. Then verify it with your Rust code.
LESSONS 03 / 04
Same value. Which variables remain usable?
Rust example to verify
Owners and data
A conceptual diagram of owners, references, and data; not an actual memory layout.
Explain it in your own words
Hint
Run the real code: cargo run -p ownership-lab · Compiler diagnostics: python3 scripts/check_compile_errors.py
LESSON 07
Failure can be a return value.
Consider a function that parses an integer and rejects negative values. It returns Result<i32, String>.
// First, verify parsing with a small example
let result = "42".parse::<i32>();
match result {
Ok(value) => println!("integer: {value}"),
Err(error) => println!("failure: {error}"),
}
"42"The code above is a reference example. Write your own implementation in ex05. cargo test -p exercises ex05 -- --ignored
LESSON 05
Did the final element run?
0..end excludes end. Change the endpoint and compare the processed elements and result.
for index in 0..3
Expected even count 2
Actual count 1
What happens with an empty array?
Subtracting one from length zero is outside the usize range and panics in this exercise’s debug build. Fixing only the final element can leave the empty-array bug unresolved.
Run the real code: ./scripts/debug-build.sh → ./target/debug/off_by_one
Inspect at a breakpoint: rust-lldb target/debug/off_by_one
After the fundamentals, explore Product diagrams: admission, queues, persistence, and responses.