Given a tuple:
let t = (1, 2, 3);
How can I collect all values of t
into, say a Vec<u8>
, without explicitly referencing each item (e.g. t.0
)?
It seems I cannot iterate or collect them the way I was expecting.
I was expecting something like this to work:
let v: Vec<u8> = t.collect();
I want to be able to easily extract all values from any tuple, such that if I have a tuple of n
elements (of the same type), I can use the same method to get all of them into an iterable.