Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Coats committed Mar 11, 2024
1 parent c6dcb11 commit 66a3414
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
28 changes: 14 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/bin/inx-chronicle/api/core/routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ async fn block(
fn create_block_metadata_response(metadata: BlockMetadata) -> ApiResult<BlockMetadataResponse> {
Ok(BlockMetadataResponse {
block_id: metadata.block_id,
block_state: metadata.block_state.ok_or(MissingError::NoResults)?.into(),
block_state: metadata.block_state.ok_or(MissingError::NoResults)?,
})
}

Expand Down
1 change: 1 addition & 0 deletions src/db/mongodb/collections/parents.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ impl ParentsCollection {
I::IntoIter: Send + Sync,
{
let docs = blocks_with_metadata.into_iter().flat_map(|b| {
#[allow(clippy::into_iter_on_ref)]
match b.block.inner().body() {
BlockBody::Basic(b) => b.strong_parents().into_iter(),
BlockBody::Validation(b) => b.strong_parents().into_iter(),
Expand Down
5 changes: 2 additions & 3 deletions src/tangle/sources/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,12 @@ impl InputSource for BTreeMap<SlotIndex, InMemoryData> {

async fn transaction_metadata(&self, transaction_id: TransactionId) -> Result<TransactionMetadata, Self::Error> {
let index = transaction_id.slot_index();
Ok(self
Ok(*self
.get(&index)
.ok_or(InMemoryInputSourceError::MissingBlockData(index))?
.transaction_metadata
.get(&transaction_id)
.ok_or(InMemoryInputSourceError::MissingTransactionMetadata(transaction_id))?
.clone())
.ok_or(InMemoryInputSourceError::MissingTransactionMetadata(transaction_id))?)
}

async fn ledger_updates(&self, index: SlotIndex) -> Result<LedgerUpdateStore, Self::Error> {
Expand Down

0 comments on commit 66a3414

Please sign in to comment.