Lazily evaluate error string
@@ -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
