C++ can do this as well with tuple unpacking. Rust copied it from C++.
From Rust's point of view
let (a, b) = function_which_returns_a_pair();
is not special compared to the idiomatic: while let Some(item) = stack.pop() { /* do stuff with items and the stack */ }
or if we hate tuples: let [a, b] = function_returns_an_array_of_two_items();In Rust "tuple unpacking" is really just a special case of pattern matching, which is a far more powerful concept and was actually taken from OCaml.