Call '.ok()' on the try_from Result in PublicKey strategy
This commit is contained in:
parent
760aa8f5eb
commit
06fddf3fb1
10
src/lib.rs
10
src/lib.rs
|
@ -103,13 +103,9 @@ impl Arbitrary for PublicKey {
|
||||||
|
|
||||||
fn arbitrary_with(_args: Self::Parameters) -> Self::Strategy {
|
fn arbitrary_with(_args: Self::Parameters) -> Self::Strategy {
|
||||||
array::uniform32(any::<u8>())
|
array::uniform32(any::<u8>())
|
||||||
.prop_filter_map(
|
.prop_filter_map("Decompressible Ristretto point", |b| {
|
||||||
"Decompressible Ristretto point",
|
PublicKey::try_from(b).ok()
|
||||||
|b| match PublicKey::try_from(b) {
|
})
|
||||||
Ok(public_key) => Some(public_key),
|
|
||||||
Err(_) => None,
|
|
||||||
},
|
|
||||||
)
|
|
||||||
.boxed()
|
.boxed()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue