Est. Reading time:
1 min
Est. Reading time:
&mut
reference of whatever it is holding.&mut [u8]
(slices are pointers to heaps vectors in rust), and the vector is 0 sized. All write will fail as there is no space on the heap to write to. And Cursor cannot extend a [u8]
as they are simple slices
&mut Vec<u8>
which will be grown as required by Cursor during write.get_ref().to_vec()