I am struggling to cast a nested array, say of type [5][5]u8
, to the corresponding nested slice type like [][]u8
.
I have a function which accepts a nested slice:
fn func(arg: [][]u8) void {...}
I have a variable of nested arrays:
var a = [_][5]u8{[_]u8{1} ** 5} ** 5;
I want to pass a
to func
. I tried the following approaches but they do not work:
func(a[0..])
func(a[0..][0..])
How can I properly cast to nested slice from nested array?
New contributor
blitzar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.