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