2 ms·
in Rust: let (a, b) = (5, 6); will de-structure the tuple, and assign 5 to a, and 6 to b. This works more generally: fn foo(tuple: (i32, i32)) { let
by steveklabnik 9y ago
in Rust:
let (a, b) = (5, 6);
will de-structure the tuple, and assign 5 to a, and 6 to b. This works more generally:
fn foo(tuple: (i32, i32)) {
let (a, b) = tuple;
or even
fn foo((a, b): (i32, i32)) {