Lazily evaluate error string (#7802)

This commit is contained in:
Joshy Orndorff authored and GitHub committed 2020-12-29 07:51:17 +00:00
1 parent 05ae24d90a
commit dd8e7587cb
1 file changed
+2 -2
@@ -39,7 +39,7 @@ pub fn authority_keys_from_seed(s: &str) -> (AuraId, GrandpaId) {
}
pub fn development_config() -> Result<ChainSpec, String> {
let wasm_binary = WASM_BINARY.ok_or("Development wasm binary not available".to_string())?;
let wasm_binary = WASM_BINARY.ok_or_else(|| "Development wasm not available".to_string())?;
Ok(ChainSpec::from_genesis(
// Name
@@ -78,7 +78,7 @@ pub fn development_config() -> Result<ChainSpec, String> {
}
pub fn local_testnet_config() -> Result<ChainSpec, String> {
let wasm_binary = WASM_BINARY.ok_or("Development wasm binary not available".to_string())?;
let wasm_binary = WASM_BINARY.ok_or_else(|| "Development wasm not available".to_string())?;
Ok(ChainSpec::from_genesis(
// Name