Use chunks_exact
Now that we are going to bump the MSRV above 1.31 we can use `chunks_exact`.
This commit is contained in:
parent
3a0097ba49
commit
6410095687
|
@ -683,13 +683,13 @@ impl TaprootMerkleBranch {
|
||||||
Err(TaprootError::InvalidMerkleTreeDepth(sl.len() / TAPROOT_CONTROL_NODE_SIZE))
|
Err(TaprootError::InvalidMerkleTreeDepth(sl.len() / TAPROOT_CONTROL_NODE_SIZE))
|
||||||
} else {
|
} else {
|
||||||
let inner = sl
|
let inner = sl
|
||||||
// TODO: Use chunks_exact after MSRV changes to 1.31
|
.chunks_exact(TAPROOT_CONTROL_NODE_SIZE)
|
||||||
.chunks(TAPROOT_CONTROL_NODE_SIZE)
|
|
||||||
.map(|chunk| {
|
.map(|chunk| {
|
||||||
sha256::Hash::from_slice(chunk)
|
sha256::Hash::from_slice(chunk)
|
||||||
.expect("chunk exact always returns the correct size")
|
.expect("chunks_exact always returns the correct size")
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
Ok(TaprootMerkleBranch(inner))
|
Ok(TaprootMerkleBranch(inner))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue