diff --git a/crates/cli/src/args.rs b/crates/cli/src/args.rs index 225b289b..838da35f 100644 --- a/crates/cli/src/args.rs +++ b/crates/cli/src/args.rs @@ -15,7 +15,8 @@ pub struct Args { long, default_value = "0:latest", allow_hyphen_values(true), - help_heading = "Content Options" + help_heading = "Content Options", + num_args = 1.. )] pub blocks: Vec, diff --git a/crates/freeze/src/datasets/blocks.rs b/crates/freeze/src/datasets/blocks.rs index b95f4fc5..bdd66c37 100644 --- a/crates/freeze/src/datasets/blocks.rs +++ b/crates/freeze/src/datasets/blocks.rs @@ -168,7 +168,7 @@ pub(crate) async fn blocks_to_dfs( } Err(e) => { println!("{:?}", e); - return Err(CollectError::TooManyRequestsError); + return Err(CollectError::TooManyRequestsError) } } } diff --git a/crates/freeze/src/datasets/blocks_and_transactions.rs b/crates/freeze/src/datasets/blocks_and_transactions.rs index 39ce711a..ca7605a7 100644 --- a/crates/freeze/src/datasets/blocks_and_transactions.rs +++ b/crates/freeze/src/datasets/blocks_and_transactions.rs @@ -110,7 +110,6 @@ async fn get_txs_gas_used( block: &Block, source: Arc, ) -> Result, CollectError> { - let source = Arc::new(source); let mut tasks = Vec::new(); for tx in &block.transactions { @@ -128,7 +127,9 @@ async fn get_txs_gas_used( }; match provider.get_transaction_receipt(tx_clone).await { Ok(Some(receipt)) => Ok(receipt.gas_used), - Ok(None) => Err(CollectError::CollectError("could not find tx receipt".to_string())), + Ok(None) => { + Err(CollectError::CollectError("could not find tx receipt".to_string())) + } Err(e) => Err(CollectError::ProviderError(e)), } }); @@ -139,9 +140,7 @@ async fn get_txs_gas_used( for task in tasks { match task.await { Ok(Ok(Some(value))) => gas_used.push(value.as_u32()), - _ => { - return Err(CollectError::CollectError("gas_used not available from node".into())) - }, + _ => return Err(CollectError::CollectError("gas_used not available from node".into())), } } diff --git a/crates/freeze/src/types/schemas.rs b/crates/freeze/src/types/schemas.rs index 56a5a6a9..83cbb5ff 100644 --- a/crates/freeze/src/types/schemas.rs +++ b/crates/freeze/src/types/schemas.rs @@ -128,7 +128,8 @@ fn compute_used_columns( let mut result: Vec = default_columns.iter().map(|s| s.to_string()).collect(); let mut result_set: HashSet = result.iter().cloned().collect(); let exclude_set: HashSet = exclude.iter().cloned().collect(); - include.iter() + include + .iter() .filter(|item| !exclude_set.contains(*item) && result_set.insert(item.to_string())) .for_each(|item| result.push(item.clone())); result @@ -136,7 +137,8 @@ fn compute_used_columns( (_, Some(include), None) => { let mut result: Vec = default_columns.iter().map(|s| s.to_string()).collect(); let mut result_set: HashSet = result.iter().cloned().collect(); - include.iter() + include + .iter() .filter(|item| result_set.insert(item.to_string())) .for_each(|item| result.push(item.clone())); result