libbpf-rs
libbpf-rs copied to clipboard
Used contained value's default for Arrays when implementing Default
This makes sure that the type identifier contained in the array is constructed with a valid default.
Since we were hardcoding ::default() after the type identifier, it was not working well with nested arrays
Example:
uint8_t pcomms[5][16];
Would fail because
[[u8; 16]::default(); 5]
is invalid.
This would turn the impl in:
[[u8::default; 16]; 5]
It's a fairly minor change that should not impact the majority of types