feat(code): map + unwrap_or -> map_or (#13)

This commit is contained in:
Zhao Ziqian
2023-02-22 06:45:35 +08:00
committed by GitHub
parent 130b47ba54
commit 71ead8889a

View File

@@ -140,8 +140,7 @@ impl SsTable {
let offset_end = self let offset_end = self
.block_metas .block_metas
.get(block_idx + 1) .get(block_idx + 1)
.map(|x| x.offset) .map_or(self.block_meta_offset, |x| x.offset);
.unwrap_or(self.block_meta_offset);
let block_data = self let block_data = self
.file .file
.read(offset as u64, (offset_end - offset) as u64)?; .read(offset as u64, (offset_end - offset) as u64)?;