Skip to content

Commit 264cfcf

Browse files
authored
Lazily evaluate error string (paritytech#7802)
1 parent 54bde60 commit 264cfcf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bin/node-template/node/src/chain_spec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ pub fn authority_keys_from_seed(s: &str) -> (AuraId, GrandpaId) {
3939
}
4040

4141
pub fn development_config() -> Result<ChainSpec, String> {
42-
let wasm_binary = WASM_BINARY.ok_or("Development wasm binary not available".to_string())?;
42+
let wasm_binary = WASM_BINARY.ok_or_else(|| "Development wasm not available".to_string())?;
4343

4444
Ok(ChainSpec::from_genesis(
4545
// Name
@@ -78,7 +78,7 @@ pub fn development_config() -> Result<ChainSpec, String> {
7878
}
7979

8080
pub fn local_testnet_config() -> Result<ChainSpec, String> {
81-
let wasm_binary = WASM_BINARY.ok_or("Development wasm binary not available".to_string())?;
81+
let wasm_binary = WASM_BINARY.ok_or_else(|| "Development wasm not available".to_string())?;
8282

8383
Ok(ChainSpec::from_genesis(
8484
// Name

0 commit comments

Comments
 (0)