minus-squaredeadcream@sopuli.xyztoRust@programming.dev•Inferred types for function calls?linkfedilinkarrow-up0arrow-down1·edit-26 months agoIt works because the size of an array in main() function is known at compile time. Arrays in Rust have fixed size, at that size is part of their type. The type of the array you pass to from() is [i32; 5] linkfedilink
It works because the size of an array in main() function is known at compile time. Arrays in Rust have fixed size, at that size is part of their type. The type of the array you pass to from() is
[i32; 5]