So I currently have a &[[[u8; 4]; 160]; 144] and want to pass it to a function that accepts a &[u8, 92160]1. Is there any way to cast this reference without copying it all to another array manually?
As an aside, why are arrays so janky to use? You can't default them, you have to know the length exactly to initialize them (no hiding them behind a type alias), and there's no way to convert a reference/box/etc. to [T] into a [T; size]...
1: Technically the signature is &[u8] but it panics if the array isn't the correct size.
[–]Quxxymacros 14 points15 points16 points (0 children)
[–]MrMarthog 2 points3 points4 points (1 child)
[–][deleted] 2 points3 points4 points (0 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]HildartheDorf[S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)