From f37f48918b955161fce42879af473f638d20f58b Mon Sep 17 00:00:00 2001 From: teor Date: Fri, 30 Oct 2020 11:48:35 +1000 Subject: [PATCH] Replace into with Some in difficulty::arbitrary --- zebra-chain/src/work/difficulty/arbitrary.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/zebra-chain/src/work/difficulty/arbitrary.rs b/zebra-chain/src/work/difficulty/arbitrary.rs index cc3d547f..4e06a450 100644 --- a/zebra-chain/src/work/difficulty/arbitrary.rs +++ b/zebra-chain/src/work/difficulty/arbitrary.rs @@ -18,9 +18,8 @@ impl Arbitrary for CompactDifficulty { // In the Zcash protocol, a CompactDifficulty is generated using the difficulty // adjustment functions. Instead of using those functions, we make a random // ExpandedDifficulty, then convert it to a CompactDifficulty. - ExpandedDifficulty::from_hash(&block::Hash(bytes)) - .to_compact() - .into() + Some(ExpandedDifficulty::from_hash(&block::Hash(bytes)) + .to_compact()) }) .boxed() } @@ -58,7 +57,7 @@ impl Arbitrary for Work { if w == 0 { None } else { - Work(w).into() + Some(Work(w)) } }) .boxed()