remove borrowed box (#272)

This commit is contained in:
Joshy Orndorff
2021-01-05 16:34:57 -05:00
committed by GitHub
parent a98bd78c0e
commit 518c6fac33
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -45,7 +45,7 @@ pub struct Extensions {
impl Extensions { impl Extensions {
/// Try to get the extension from the given `ChainSpec`. /// Try to get the extension from the given `ChainSpec`.
pub fn try_get(chain_spec: &Box<dyn sc_service::ChainSpec>) -> Option<&Self> { pub fn try_get(chain_spec: &dyn sc_service::ChainSpec) -> Option<&Self> {
sc_chain_spec::get_extension(chain_spec.extensions()) sc_chain_spec::get_extension(chain_spec.extensions())
} }
} }
+1 -1
View File
@@ -270,7 +270,7 @@ pub fn run() -> Result<()> {
// TODO // TODO
let key = sp_core::Pair::generate().0; let key = sp_core::Pair::generate().0;
let extension = chain_spec::Extensions::try_get(&config.chain_spec); let extension = chain_spec::Extensions::try_get(&*config.chain_spec);
let relay_chain_id = extension.map(|e| e.relay_chain.clone()); let relay_chain_id = extension.map(|e| e.relay_chain.clone());
let para_id = extension.map(|e| e.para_id); let para_id = extension.map(|e| e.para_id);
+1 -1
View File
@@ -46,7 +46,7 @@ pub struct Extensions {
impl Extensions { impl Extensions {
/// Try to get the extension from the given `ChainSpec`. /// Try to get the extension from the given `ChainSpec`.
pub fn try_get(chain_spec: &Box<dyn sc_service::ChainSpec>) -> Option<&Self> { pub fn try_get(chain_spec: &dyn sc_service::ChainSpec) -> Option<&Self> {
sc_chain_spec::get_extension(chain_spec.extensions()) sc_chain_spec::get_extension(chain_spec.extensions())
} }
} }