Replacement for missing variadic arguments

Hi, I'm in the process of learning Rust, so please be patient. :slight_smile:

I red in Rust, except for some exceptional cases, there are no function variadic arguments.

In a function I need to pass an unknown number of vectors.

At the moment, I pass a vector of vectors.

Is there any other 'rusty' solution?

Thanks in advance

Passing a vector of vectors is probably fine when you need to pass some number of vectors.

1 Like

Another option is to pass in an Iterator that the function can then loop over.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.