Replace into with Some in difficulty::arbitrary

This commit is contained in:
teor 2020-10-30 11:48:35 +10:00 committed by Henry de Valence
parent d883462d83
commit f37f48918b
1 changed files with 3 additions and 4 deletions

View File

@ -18,9 +18,8 @@ impl Arbitrary for CompactDifficulty {
// In the Zcash protocol, a CompactDifficulty is generated using the difficulty // In the Zcash protocol, a CompactDifficulty is generated using the difficulty
// adjustment functions. Instead of using those functions, we make a random // adjustment functions. Instead of using those functions, we make a random
// ExpandedDifficulty, then convert it to a CompactDifficulty. // ExpandedDifficulty, then convert it to a CompactDifficulty.
ExpandedDifficulty::from_hash(&block::Hash(bytes)) Some(ExpandedDifficulty::from_hash(&block::Hash(bytes))
.to_compact() .to_compact())
.into()
}) })
.boxed() .boxed()
} }
@ -58,7 +57,7 @@ impl Arbitrary for Work {
if w == 0 { if w == 0 {
None None
} else { } else {
Work(w).into() Some(Work(w))
} }
}) })
.boxed() .boxed()