Skip to content

Tuples

(i64, Str) groups values without naming a struct: return two things, key a map by a pair. Parts are read with t.0, t.1, and taken apart with let (q, r) = divmod(a, b) or for (k, v) in &map. In a match, a tuple pattern like (0, Dir.Left) binds plain names ((n, _)), and the match is complete when every combination of the parts’ cases (bools, enum variants, Some/None) has an arm. Tuples have at least two parts.