Skip to content

Commit

Permalink
Merge pull request #161 from rex4539/clippy
Browse files Browse the repository at this point in the history
fix clippy warnings
  • Loading branch information
idky137 authored Jan 20, 2025
2 parents ed7f1f0 + 85bf84a commit 72e8c42
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions zaino-state/src/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ impl ZcashIndexer for FetchServiceSubscriber {
.get_subtrees_by_index(
pool,
start_index.0,
limit.and_then(|limit_index| Some(limit_index.0)),
limit.map(|limit_index| limit_index.0),
)
.await?
.into())
Expand Down Expand Up @@ -1408,7 +1408,7 @@ impl LightWalletIndexer for FetchServiceSubscriber {
.z_get_subtrees_by_index(
pool.to_string(),
NoteCommitmentSubtreeIndex(start_index),
limit.and_then(|limit| Some(NoteCommitmentSubtreeIndex(limit))),
limit.map(NoteCommitmentSubtreeIndex),
)
.await?;
let fetch_service_clone = self.clone();
Expand Down Expand Up @@ -1756,12 +1756,12 @@ impl FetchServiceSubscriber {
u32::try_from(trees.orchard())?,
)?)
}
Err(e) => Err(e.into()),
Err(e) => Err(e),
},
Ok(GetBlock::Raw(_)) => Err(FetchServiceError::TonicStatusError(
tonic::Status::internal("Received raw block hex instead of block object."),
)),
Err(e) => Err(e.into()),
Err(e) => Err(e),
}
}

Expand Down
6 changes: 3 additions & 3 deletions zaino-state/src/mempool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ impl Mempool {
loop {
match mempool.fetcher.get_blockchain_info().await {
Ok(chain_info) => {
best_block_hash = chain_info.best_block_hash.clone();
best_block_hash = chain_info.best_block_hash;
break;
}
Err(e) => {
Expand All @@ -120,7 +120,7 @@ impl Mempool {
loop {
match mempool.fetcher.get_blockchain_info().await {
Ok(chain_info) => {
check_block_hash = chain_info.best_block_hash.clone();
check_block_hash = chain_info.best_block_hash;
}
Err(e) => {
status.store(StatusType::RecoverableError.into());
Expand Down Expand Up @@ -404,7 +404,7 @@ impl MempoolSubscriber {
Ok((StatusType::Syncing, self.get_mempool_and_update_seen()))
}
StatusType::Closing => Ok((StatusType::Closing, Vec::new())),
status => return Err(MempoolError::StatusError(StatusError(status))),
status => Err(MempoolError::StatusError(StatusError(status))),
}
}

Expand Down
4 changes: 2 additions & 2 deletions zainod/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ impl IndexerConfig {
"Testnet" => Ok(zebra_chain::parameters::Network::new_default_testnet()),
"Mainnet" => Ok(zebra_chain::parameters::Network::Mainnet),
_ => {
return Err(IndexerError::ConfigError(
Err(IndexerError::ConfigError(
"Incorrect network name given.".to_string(),
));
))
}
}
}
Expand Down

0 comments on commit 72e8c42

Please sign in to comment.