From 06fddf3fb115dd109ba9edba66c60d6762474092 Mon Sep 17 00:00:00 2001 From: Deirdre Connolly Date: Mon, 11 May 2020 23:36:04 -0400 Subject: [PATCH] Call '.ok()' on the try_from Result in PublicKey strategy --- src/lib.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index d469014..d77e0fe 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -103,13 +103,9 @@ impl Arbitrary for PublicKey { fn arbitrary_with(_args: Self::Parameters) -> Self::Strategy { array::uniform32(any::()) - .prop_filter_map( - "Decompressible Ristretto point", - |b| match PublicKey::try_from(b) { - Ok(public_key) => Some(public_key), - Err(_) => None, - }, - ) + .prop_filter_map("Decompressible Ristretto point", |b| { + PublicKey::try_from(b).ok() + }) .boxed() }