4 ms·
Varargs with the same type is just a list. In many languages that could require an extra allocation, but in Rust that can just be a slice or maybe a an array wi
by the_duke 4y ago
Varargs with the same type is just a list. In many languages that could require an extra allocation, but in Rust that can just be a slice or maybe a an array with a const generic for it's size if you want to pass ownership.
Varargs here would really just be a minor ergonomics improvement.
Heterogeneous varargs would be more useful, but would require something like variadic generics. (which have been proposed before)