Skip to content

Commit

Permalink
Applied clippy changes
Browse files Browse the repository at this point in the history
  • Loading branch information
chamorin committed Feb 2, 2024
1 parent 658f7d0 commit ed5fa65
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/pb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ impl TryFrom<FirehoseBlock> for Block {
diff: Some(block.diff.try_into()?),
height: block.height,
hash: bd(&block.hash)?,
tx_root: block.tx_root.unwrap_or_default().try_into()?,
tx_root: block.tx_root.unwrap_or_default().into(),
txs: block
.txs
.into_iter()
Expand All @@ -88,7 +88,7 @@ impl TryFrom<FirehoseBlock> for Block {
weave_size: Some(block.weave_size.try_into()?),
block_size: Some(block.block_size.try_into()?),
cumulative_diff: Some(block.cumulative_diff.try_into()?),
hash_list_merkle: block.hash_list_merkle.unwrap_or_default().try_into()?,
hash_list_merkle: block.hash_list_merkle.unwrap_or_default().into(),
poa: block.poa.and_then(|p| p.try_into().ok()),
})
}
Expand Down
14 changes: 7 additions & 7 deletions src/polling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl Polling {
forever,
latest: 0,
ptr: 0,
quiet: quiet,
quiet,
};

poller.initialize_start_ptr(ptr).await?;
Expand Down Expand Up @@ -115,26 +115,26 @@ impl Polling {

self.latest_irreversible_block_num()
.await
.and_then(|live_block| {
.map(|live_block| {
log::info!(
"start block explicitely provided, starting from live block {}",
"start block explicitly provided, starting from live block {}",
live_block
);

Ok(live_block)
live_block
})
}

async fn start_ptr_from_flag_value(&self, value: &String) -> Result<u64> {
value
.parse::<u64>()
.and_then(|value| {
.map(|value| {
log::info!(
"start block explicitely provided, starting from block {}",
"start block explicitly provided, starting from block {}",
value
);

Ok(value)
value
})
.context(format_args!("start {} is not a valid u64 string value", value).to_string())
.map_err(Into::into)
Expand Down

0 comments on commit ed5fa65

Please sign in to comment.