summaryrefslogtreecommitdiffstats
path: root/openpgp/src/fingerprint.rs
diff options
context:
space:
mode:
authorNora Widdecke <nora@sequoia-pgp.org>2020-05-12 17:07:44 +0200
committerNora Widdecke <nora@sequoia-pgp.org>2020-06-08 14:36:13 +0200
commitc51d96b98f1ed92fe7bc6d964abb0d2a8616bae1 (patch)
tree9fb9ea374e712da619c0985b9ddc0f4377b0b749 /openpgp/src/fingerprint.rs
parent5be97d9c6ee82f068a5b38aa455f31497d3f20bf (diff)
openpgp: Introduce feature flag for quickcheck.
- Make quickcheck dependency optional. - Make quickcheck a dev-dependency for tests. - Fix doctests for - cert::ValidCert::user_attributes, - cert::builder::CertBuilder::add_user_attribute, - cert::revoke::UserAttributeRevocationBuilder - cert::revoke::UserAttributeRevocationBuilder::build. Doctests do not use cfg(test), so we cannot use quickcheck in there.
Diffstat (limited to 'openpgp/src/fingerprint.rs')
-rw-r--r--openpgp/src/fingerprint.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/openpgp/src/fingerprint.rs b/openpgp/src/fingerprint.rs
index 6094229f..a88dafdd 100644
--- a/openpgp/src/fingerprint.rs
+++ b/openpgp/src/fingerprint.rs
@@ -1,4 +1,6 @@
use std::fmt;
+
+#[cfg(any(test, feature = "quickcheck"))]
use quickcheck::{Arbitrary, Gen};
/// A long identifier for certificates and keys.
@@ -206,6 +208,7 @@ impl Fingerprint {
}
}
+#[cfg(any(test, feature = "quickcheck"))]
impl Arbitrary for Fingerprint {
fn arbitrary<G: Gen>(g: &mut G) -> Self {
use rand::Rng;