Try to workaround the invalid compilation (#159)

There is probably some bug in rustc which result in an invalid
compilation when using an `expect` at the given position. I'm still not
sure why this is happening, but this fix should fix it for now.
This commit is contained in:
Bastian Köcher
2020-07-27 10:28:05 +02:00
committed by GitHub
parent 93e0ae472b
commit c5f59ed83d
@@ -253,10 +253,11 @@ impl<B: BlockT> Storage for WitnessStorage<B> {
}; };
for x in TrieDBIterator::new_prefixed(&trie, prefix).expect("Creates trie iterator") { for x in TrieDBIterator::new_prefixed(&trie, prefix).expect("Creates trie iterator") {
let (key, _) = x.expect("Iterating trie iterator"); if let Ok((key, _)) = x {
self.overlay.insert(key, None); self.overlay.insert(key, None);
} }
} }
}
fn storage_append(&mut self, key: &[u8], value: Vec<u8>) { fn storage_append(&mut self, key: &[u8], value: Vec<u8>) {
let value_vec = sp_std::vec![EncodeOpaqueValue(value)]; let value_vec = sp_std::vec![EncodeOpaqueValue(value)];