ok_or -> ok_or_else

This commit is contained in:
NikVolf
2017-12-21 16:50:58 +03:00
parent ab2caee0a3
commit 516725abe4
8 changed files with 10 additions and 10 deletions

View File

@@ -121,7 +121,7 @@ mod server {
// Attempt to sign in the engine signer.
let password = deps.accounts_passwords.iter()
.find(|p| deps.account_provider.sign(account.clone(), Some((*p).clone()), Default::default()).is_ok())
.ok_or(format!("No valid password for the secret store node account {}", account))?;
.ok_or_else(|| format!("No valid password for the secret store node account {}", account))?;
Arc::new(ethcore_secretstore::KeyStoreNodeKeyPair::new(deps.account_provider, account, password.clone())
.map_err(|e| format!("{}", e))?)
},