Skip to content

Commit 89e8806

Browse files
committed
Move statement_protocol_config extraction before match to fix scope
1 parent 9fc5225 commit 89e8806

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

light-base/src/lib.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,8 @@ impl<TPlat: platform::PlatformRef, TChain> Client<TPlat, TChain> {
672672
}
673673
};
674674

675+
let statement_protocol_config = config.statement_protocol_config;
676+
675677
// Start the services of the chain to add, or grab the services if they already exist.
676678
let (services, log_name) = match chains_by_key.entry(new_chain_key.clone()) {
677679
Entry::Occupied(mut entry) => {
@@ -696,9 +698,6 @@ impl<TPlat: platform::PlatformRef, TChain> Client<TPlat, TChain> {
696698
self.platform.client_version()
697699
);
698700

699-
let statement_protocol_config = config.statement_protocol_config;
700-
let statement_protocol_config_for_rpc = statement_protocol_config.clone();
701-
702701
let config = match (&relay_chain, &chain_information) {
703702
(Some((relay_chain, para_id, _)), Some(chain_information)) => {
704703
StartServicesChainTy::Parachain {
@@ -738,7 +737,7 @@ impl<TPlat: platform::PlatformRef, TChain> Client<TPlat, TChain> {
738737
chain_spec.fork_id().map(|f| f.to_owned()),
739738
config,
740739
network_identify_agent_version,
741-
statement_protocol_config,
740+
statement_protocol_config.clone(),
742741
)
743742
};
744743

@@ -952,7 +951,7 @@ impl<TPlat: platform::PlatformRef, TChain> Client<TPlat, TChain> {
952951
system_name: self.platform.client_name().into_owned(),
953952
system_version: self.platform.client_version().into_owned(),
954953
genesis_block_hash,
955-
statement_protocol_config: statement_protocol_config_for_rpc,
954+
statement_protocol_config,
956955
});
957956

958957
Some(frontend)

0 commit comments

Comments
 (0)