thomas-shirley.com

Understanding Tuples

Coming from a PHP & Javascript background, I found the Tuple datatype in Rust quite strange.

In PHP or Javascript, it is entirely possible to pass an entire array into a function. However this is not the case with Rust. It doesn't seem that there is a datatype you can set as an input parameter for the function.

Damn. So, what does this mean? Well, for starters it means that instead of passing your whole Tuple into the function, you're going to have to deal with the values one by one or, access the Tuple from the global scope.

29-08-2021