Question about initializing a GenericArray

I have the following rust code: Rust Playground

I'm asking about line 35, and what other options I have for initializing the array of packets?

You can use clone_from_slice or from_exact_iter, if you know the array length you can use convert arrays into generic array (up to size 32) or the arr macro. But for what you are asking, using generate is probably the best way.

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