Upgrade elastic-array to 0.9.0

This is a huge change, which includes some changes to replace code that
originally cloned to reuse allocations instead. The updated
`elastic-array` crate renames its consuming `Vec`-conversion method to
`into_vec`, which means that I can do a simple
`sed -i 's/to_vec/into_vec/'` and then fix the compilation errors.

This commit is probably a minor performance win and definitely a
significant readability win.
This commit is contained in:
Vurich
2017-06-28 14:16:53 +02:00
parent 826bf28196
commit 3d8dc11442
76 changed files with 212 additions and 211 deletions

View File

@@ -139,7 +139,7 @@ impl Engine for BasicAuthority {
if self.validators.contains(header.parent_hash(), author) {
// account should be pernamently unlocked, otherwise sealing will fail
if let Ok(signature) = self.signer.sign(header.bare_hash()) {
return Seal::Regular(vec![::rlp::encode(&(&H520::from(signature) as &[u8])).to_vec()]);
return Seal::Regular(vec![::rlp::encode(&(&H520::from(signature) as &[u8])).into_vec()]);
} else {
trace!(target: "basicauthority", "generate_seal: FAIL: accounts secret key unavailable");
}
@@ -301,7 +301,7 @@ mod tests {
fn can_do_signature_verification_fail() {
let engine = new_test_authority().engine;
let mut header: Header = Header::default();
header.set_seal(vec![::rlp::encode(&H520::default()).to_vec()]);
header.set_seal(vec![::rlp::encode(&H520::default()).into_vec()]);
let verify_result = engine.verify_block_family(&header, &Default::default(), None);
assert!(verify_result.is_err());