Both solution don't use heap allocation but pass around the array data by value on the stack or packed into register and should compile to the same assembly code (ABI differences aside).
That's also one of the rare cases where Rust code actually turns out more simple and readable than the C equivalent ;)
That's also one of the rare cases where Rust code actually turns out more simple and readable than the C equivalent ;)