Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix some clippy warnings #218

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/cli/src/parse/blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/src/parse/timestamps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion crates/freeze/src/datasets/address_appearances.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions crates/freeze/src/datasets/erc721_transfers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Query>) -> R<()> {
Expand All @@ -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
}

Expand Down