Skip to content

Commit

Permalink
Run clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
emesare committed Dec 4, 2024
1 parent 15b113f commit f6f20b5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
7 changes: 2 additions & 5 deletions src/id0/address_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,7 @@ impl<'a> Iterator for AddressInfoIter<'a> {
return true
};
let id_value = id_from_key(id, self.is_64);
match (*sub_type, id_value) {
(b'S', Some(0x3000..=0x3999)) => false,
_ => true,
}
!matches!((*sub_type, id_value), (b'S', Some(0x3000..=0x3999)))
}).unwrap_or(0);
// TODO enforce sequential index for the id?
// get the entry for field names and rest of data
Expand All @@ -122,7 +119,7 @@ impl<'a> Iterator for AddressInfoIter<'a> {
self.entries = &rest[last..];

// condensate the data into a single buffer
let buf: Vec<u8> = current.value.iter().chain(continuation.iter().map(|entry| &entry.value[..]).flatten()).copied().collect();
let buf: Vec<u8> = current.value.iter().chain(continuation.iter().flat_map(|entry| &entry.value[..])).copied().collect();
// create the raw type
let til = match til::Type::new_from_id0(&buf[..], fields) {
Ok(til) => til,
Expand Down
4 changes: 2 additions & 2 deletions src/id0/btree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -616,8 +616,8 @@ impl ID0Section {
let region = region?;
let start_key: Vec<u8> = key_from_address(region.start, self.is_64).collect();
let end_key: Vec<u8> = key_from_address(region.end, self.is_64).collect();
let start = self.binary_search(&start_key).unwrap_or_else(|start| start);
let end = self.binary_search(&end_key).unwrap_or_else(|end| end);
let start = self.binary_search(start_key).unwrap_or_else(|start| start);
let end = self.binary_search(end_key).unwrap_or_else(|end| end);

let entries = &self.entries[start..end];
Ok(AddressInfoIter::new(entries, self.is_64))
Expand Down

0 comments on commit f6f20b5

Please sign in to comment.