How can I correctly implement this code below?
let mut bigger: [u8; 100] = [0u8; 100];
let smaller: [u8; 3] = [1, 2, 3];
// do something like:
// bigger[0..3] = smaller;
Use copy_from_slice:
bigger[0..3].copy_from_slice(&smaller);
(Playground)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With