Additionally Vec::with_capacity is used to pre-allocate the right amount of memory and iterators are used instead of for loops to set the values in data. The extend_from_slice method is used to push a whole slice into data instead of pushing element by element.
See Issue #2
Additionally
Vec::with_capacity
is used to pre-allocate the right amount of memory and iterators are used instead of for loops to set the values indata
. Theextend_from_slice
method is used to push a whole slice into data instead of pushing element by element.