Skip to content

Commit

Permalink
fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
shekhirin committed Nov 16, 2023
1 parent bad45bc commit 7f3a7b5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions crates/primitives/src/integer_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl IntegerList {
/// Returns an error if the list is empty or not pre-sorted.
pub fn new<T: AsRef<[u64]>>(list: T) -> Result<Self, RoaringBitmapError> {
Ok(Self(
RoaringTreemap::from_sorted_iter(list.as_ref().into_iter().copied())
RoaringTreemap::from_sorted_iter(list.as_ref().iter().copied())
.map_err(|_| RoaringBitmapError::InvalidInput)?,
))
}
Expand All @@ -47,7 +47,7 @@ impl IntegerList {
/// Panics if the list is empty or not pre-sorted.
pub fn new_pre_sorted<T: AsRef<[u64]>>(list: T) -> Self {
Self(
RoaringTreemap::from_sorted_iter(list.as_ref().into_iter().copied())
RoaringTreemap::from_sorted_iter(list.as_ref().iter().copied())
.expect("IntegerList must be pre-sorted and non-empty"),
)
}
Expand Down Expand Up @@ -139,7 +139,7 @@ impl<'a> Arbitrary<'a> for IntegerList {
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self, arbitrary::Error> {
let mut nums: Vec<u64> = Vec::arbitrary(u)?;
nums.sort();
Ok(Self::new(nums).map_err(|_| arbitrary::Error::IncorrectFormat)?)
Self::new(nums).map_err(|_| arbitrary::Error::IncorrectFormat)
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/storage/provider/src/providers/database/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ impl<TX: DbTxMut + DbTx> DatabaseProvider<TX> {
let mut chunks = chunks.into_iter().peekable();
while let Some(list) = chunks.next() {
let highest_block_number = if chunks.peek().is_some() {
*list.last().expect("`chunks` does not return empty list") as u64
*list.last().expect("`chunks` does not return empty list")
} else {
// Insert last list with u64::MAX
u64::MAX
Expand Down

0 comments on commit 7f3a7b5

Please sign in to comment.