diff --git a/src/pb.rs b/src/pb.rs index 3b883e6..33f1d52 100644 --- a/src/pb.rs +++ b/src/pb.rs @@ -69,7 +69,7 @@ impl TryFrom 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() @@ -88,7 +88,7 @@ impl TryFrom 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()), }) } diff --git a/src/polling.rs b/src/polling.rs index 9b64bd4..f4a35e7 100644 --- a/src/polling.rs +++ b/src/polling.rs @@ -59,7 +59,7 @@ impl Polling { forever, latest: 0, ptr: 0, - quiet: quiet, + quiet, }; poller.initialize_start_ptr(ptr).await?; @@ -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 { value .parse::() - .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)