Fix tons of warnings in newest nightly (#2784)

* Fix tons of warnings in newest nightly

* Fix sr-api-macro doc tests
This commit is contained in:
Bastian Köcher
2019-06-04 20:09:49 +02:00
committed by GitHub
parent 9700029203
commit 6142f95611
73 changed files with 359 additions and 316 deletions
@@ -193,17 +193,17 @@ impl<'a, S, H> Backend<H> for ProvingBackend<'a, S, H>
pub fn create_proof_check_backend<H>(
root: H::Out,
proof: Vec<Vec<u8>>
) -> Result<TrieBackend<MemoryDB<H>, H>, Box<Error>>
) -> Result<TrieBackend<MemoryDB<H>, H>, Box<dyn Error>>
where
H: Hasher,
{
let db = create_proof_check_backend_storage(proof);
if !db.contains(&root, &[]) {
return Err(Box::new(ExecutionError::InvalidProof) as Box<Error>);
if db.contains(&root, &[]) {
Ok(TrieBackend::new(db, root))
} else {
Err(Box::new(ExecutionError::InvalidProof))
}
Ok(TrieBackend::new(db, root))
}
/// Create in-memory storage of proof check backend.