Fix code according to clippy lints

master
Ishan Jain 4 months ago
parent df44ded31a
commit 017f2c52bf
  1. 3
      src/main.rs
  2. 3
      src/varint.rs

@ -140,7 +140,7 @@ fn parse_page<'a>(
BTreePage::InteriorTable => {
let rows = cell_pointers
.into_iter()
.map(move |cp| {
.filter_map(move |cp| {
let stream = &database[table_page_offset + cp as usize..];
let left_child_id =
u32::from_be_bytes([stream[0], stream[1], stream[2], stream[3]]);
@ -154,7 +154,6 @@ fn parse_page<'a>(
db_header.page_size as usize * (left_child_id as usize - 1),
)
})
.flatten()
.flatten();
if let Some(rp) = page_header.right_most_pointer {

@ -30,8 +30,7 @@ fn usable_value(usable_size: u8, byte: u8) -> u8 {
fn read_usable_bytes(stream: &[u8]) -> Vec<u8> {
let mut usable_bytes = vec![];
for i in 0..8 {
let byte = stream[i];
for &byte in stream.iter().take(8) {
usable_bytes.push(byte);
if starts_with_zero(byte) {
break;

Loading…
Cancel
Save