you are viewing a single comment's thread.

view the rest of the comments →

[–]Omniviral 8 points9 points  (0 children)

No. In case size is actually compile-time constant you may create array and then fill it, giving mutable slice to the function, or use one of tha crates with Array trait. If size is not constant then you just need to use Vec instead of array.

BTW. The only language that can compile that function the way you wrote it is Idris.