Fix clippy lints

This commit is contained in:
Paul Hauner
2019-01-04 18:30:24 +11:00
parent 62640ad691
commit 3876e29f6e
9 changed files with 25 additions and 18 deletions

View File

@@ -15,8 +15,8 @@ pub enum ForkChoiceError {
}
pub fn naive_fork_choice<T>(
head_block_hashes: &Vec<Hash256>,
block_store: Arc<BeaconBlockStore<T>>,
head_block_hashes: &[Hash256],
block_store: &Arc<BeaconBlockStore<T>>,
) -> Result<Option<usize>, ForkChoiceError>
where
T: ClientDB + Sized,
@@ -28,7 +28,7 @@ where
*/
for (index, block_hash) in head_block_hashes.iter().enumerate() {
let ssz = block_store
.get(&block_hash.to_vec()[..])?
.get(&block_hash)?
.ok_or(ForkChoiceError::MissingBlock)?;
let (block, _) = BeaconBlock::ssz_decode(&ssz, 0)?;
head_blocks.push((index, block));