|
pub fn as_data_flatten(&self) -> Vec<u8> { |
I think it would be a good idea to replace the current function body with
let total_len = self.data.len() * 4;
let mut result = Vec::with_capacity(total_len);
for p in &self.data {
result.extend_from_slice(&p.to_raw());
}
result
, but before that the two versions must be bench marked.