unwrap_or_else

This commit is contained in:
Trent Nelson
2019-11-02 10:40:14 -06:00
parent 486f01790c
commit a8f8c3bfbe

View File

@ -546,8 +546,7 @@ impl Bank {
let id = sysvar::recent_blockhashes::id();
let mut account = self
.get_account(&id)
.or_else(|| Some(sysvar::recent_blockhashes::create_account(1)))
.unwrap();
.unwrap_or_else(|| sysvar::recent_blockhashes::create_account(1));
sysvar::recent_blockhashes::update_account(&mut account, recent_blockhashes).unwrap();
self.store_account(&id, &account);
}