use idomatic rust

This commit is contained in:
aniketfuryrocks 2023-02-05 14:32:36 +05:30
parent 819724c360
commit 419820cde2
No known key found for this signature in database
GPG Key ID: FA6BFCFAA7D4B764
1 changed files with 6 additions and 6 deletions

View File

@ -25,7 +25,9 @@ use solana_rpc_client_api::{
response::{Response as RpcResponse, RpcBlockhash, RpcResponseContext, RpcVersionInfo},
};
use solana_sdk::{
commitment_config::CommitmentConfig, hash::Hash, pubkey::Pubkey,
commitment_config::{self, CommitmentConfig},
hash::Hash,
pubkey::Pubkey,
transaction::VersionedTransaction,
};
use solana_transaction_status::TransactionStatus;
@ -221,11 +223,9 @@ impl LiteRpcServer for LiteBridge {
&self,
config: Option<RpcContextConfig>,
) -> crate::rpc::Result<RpcResponse<RpcBlockhash>> {
let commitment_config = if let Some(RpcContextConfig { commitment, .. }) = config {
commitment.unwrap_or_default()
} else {
CommitmentConfig::default()
};
let commitment_config = config
.map(|config| config.commitment.unwrap_or_default())
.unwrap_or_default();
let (blockhash, BlockInformation { slot, block_height }) = self
.block_store