diff --git a/crates/cli/src/parse/blocks.rs b/crates/cli/src/parse/blocks.rs index a9e75df2..fe501a62 100644 --- a/crates/cli/src/parse/blocks.rs +++ b/crates/cli/src/parse/blocks.rs @@ -20,7 +20,7 @@ pub(crate) async fn parse_blocks( for path in files { let column = if path.contains(':') { path.split(':') - .last() + .next_back() .ok_or(ParseError::ParseError("could not parse txs path column".to_string()))? } else { "block_number" diff --git a/crates/cli/src/parse/timestamps.rs b/crates/cli/src/parse/timestamps.rs index 35b54ab8..835ab1f8 100644 --- a/crates/cli/src/parse/timestamps.rs +++ b/crates/cli/src/parse/timestamps.rs @@ -24,7 +24,7 @@ pub(crate) async fn parse_timestamps( for path in files { let column = if path.contains(':') { path.split(':') - .last() + .next_back() .ok_or(ParseError::ParseError("could not parse txs path column".to_string()))? } else { "timestamp" diff --git a/crates/freeze/src/datasets/address_appearances.rs b/crates/freeze/src/datasets/address_appearances.rs index c3600105..59f568dd 100644 --- a/crates/freeze/src/datasets/address_appearances.rs +++ b/crates/freeze/src/datasets/address_appearances.rs @@ -114,7 +114,7 @@ impl CollectByTransaction for AddressAppearances { fn name(log: &Log) -> Option<&'static str> { let event = log.topic0().unwrap(); if event == *ERC20::Transfer::SIGNATURE_HASH { - if log.data().data.len() > 0 { + if !log.data().data.is_empty() { Some("erc20_transfer") } else if log.topics().len() == 4 { Some("erc721_transfer") diff --git a/crates/freeze/src/datasets/erc721_transfers.rs b/crates/freeze/src/datasets/erc721_transfers.rs index 065dc176..8d3a4a2c 100644 --- a/crates/freeze/src/datasets/erc721_transfers.rs +++ b/crates/freeze/src/datasets/erc721_transfers.rs @@ -71,7 +71,7 @@ impl CollectByBlock for Erc721Transfers { let filter = Filter { topics, ..request.ethers_log_filter()? }; let logs = source.get_logs(&filter).await?; - Ok(logs.into_iter().filter(|x| x.topics().len() == 4 && x.data().data.len() == 0).collect()) + Ok(logs.into_iter().filter(|x| x.topics().len() == 4 && x.data().data.is_empty()).collect()) } fn transform(response: Self::Response, columns: &mut Self, query: &Arc) -> R<()> { @@ -97,7 +97,7 @@ impl CollectByTransaction for Erc721Transfers { fn is_erc721_transfer(log: &Log) -> bool { log.topics().len() == 4 && - log.data().data.len() == 0 && + log.data().data.is_empty() && log.topics()[0] == ERC721::Transfer::SIGNATURE_HASH }