Create an array from a tuple

Viewed 4950

I can create an array from a tuple like this:

let a = (1, 2, 3);
let b = [a.0, a.1, a.2];

Is there a way to do it without naming each element of the tuple? Something like:

let b = a.to_array();
2 Answers
Related