我有一个未知大小的数组,我想获得该数组的一部分并将其转换为静态大小的数组:
fn pop(barry: &[u8]) -> [u8; 3] { barry[0..3] // mismatched types: expected `[u8, ..3]` but found `&[u8]` }
我该怎么做?
arrays rust
arrays ×1
rust ×1