Something like this:
let vector = vec![(1, 2), ("A", 2, 3)];
If this isn't possible, what other alternatives could I use? For the sake of example, assume the length of the vector is unknown and the length of tuples is between 1 - 5 elements.
Use a enum with variants for each desired tuple length (and each allowed combination of component types if necessary).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With