Skip to content

Commit

Permalink
Merge pull request #30 from meilisearch/flat-map-instead-flatten
Browse files Browse the repository at this point in the history
Replace a `flatten` by a `flat_map`
  • Loading branch information
Kerollmops committed Mar 1, 2022
2 parents 66162d9 + bbb3b9c commit dd79a33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/block_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ impl BlockWriter {
// We write the index offsets at the end of the file,
// followed by the number of index offsets.
let index_offsets_count: u32 = self.index_offsets.len().try_into().unwrap();
self.buffer.extend(self.index_offsets.iter().copied().map(u64::to_be_bytes).flatten());
self.buffer.extend(self.index_offsets.iter().copied().flat_map(u64::to_be_bytes));
self.buffer.extend_from_slice(&index_offsets_count.to_be_bytes());

BlockBuffer { block_builder: self }
Expand Down

0 comments on commit dd79a33

Please sign in to comment.