Array Iteration
The for
statement supports iterating over arrays (but not tuples).
Speaker Notes
This slide should take about 3 minutes.
This functionality uses the IntoIterator
trait, but we haven’t covered that
yet.
The assert_ne!
macro is new here. There are also assert_eq!
and assert!
macros. These are always checked, while debug-only variants like debug_assert!
compile to nothing in release builds.