Skip to content

Commit

Permalink
Clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
lann committed Aug 28, 2023
1 parent 99f1b62 commit 8dd383e
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions crates/server/src/services/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ impl<Digest: SupportedDigest> CoreService<Digest> {
) -> Result<LogProofBundle<Digest, LogLeaf>, CoreServiceError> {
let state = self.inner.state.read().await;

let proof = state
.log
.prove_consistency(from_log_length as usize, to_log_length as usize);
let proof = state.log.prove_consistency(from_log_length, to_log_length);
LogProofBundle::bundle(vec![proof], vec![], &state.log)
.map_err(CoreServiceError::BundleFailure)
}
Expand All @@ -96,13 +94,13 @@ impl<Digest: SupportedDigest> CoreService<Digest> {

let proofs = entries
.iter()
.map(|index| {
let node = if *index < state.leaf_index.len() as RegistryIndex {
state.leaf_index[*index as usize]
.map(|&index| {
let node = if index < state.leaf_index.len() as RegistryIndex {
state.leaf_index[index]
} else {
return Err(CoreServiceError::LeafNotFound(*index));
return Err(CoreServiceError::LeafNotFound(index));
};
Ok(state.log.prove_inclusion(node, log_length as usize))
Ok(state.log.prove_inclusion(node, log_length))
})
.collect::<Result<Vec<_>, CoreServiceError>>()?;

Expand Down

0 comments on commit 8dd383e

Please sign in to comment.