diff options
author | Nora Widdecke <nora@sequoia-pgp.org> | 2020-05-12 17:07:44 +0200 |
---|---|---|
committer | Nora Widdecke <nora@sequoia-pgp.org> | 2020-06-08 14:36:13 +0200 |
commit | c51d96b98f1ed92fe7bc6d964abb0d2a8616bae1 (patch) | |
tree | 9fb9ea374e712da619c0985b9ddc0f4377b0b749 /openpgp/src/types/server_preferences.rs | |
parent | 5be97d9c6ee82f068a5b38aa455f31497d3f20bf (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/types/server_preferences.rs')
-rw-r--r-- | openpgp/src/types/server_preferences.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/openpgp/src/types/server_preferences.rs b/openpgp/src/types/server_preferences.rs index f0b38f7e..b97cee58 100644 --- a/openpgp/src/types/server_preferences.rs +++ b/openpgp/src/types/server_preferences.rs @@ -1,5 +1,7 @@ use std::hash::{Hash, Hasher}; use std::fmt; + +#[cfg(any(test, feature = "quickcheck"))] use quickcheck::{Arbitrary, Gen}; /// Describes preferences regarding key servers. @@ -165,6 +167,7 @@ const KEYSERVER_PREFERENCE_NO_MODIFY: u8 = 0x80; /// Number of bytes with known flags. const KEYSERVER_PREFERENCES_N_KNOWN_BYTES: usize = 1; +#[cfg(any(test, feature = "quickcheck"))] impl Arbitrary for KeyServerPreferences { fn arbitrary<G: Gen>(g: &mut G) -> Self { Self::new(Vec::arbitrary(g)) |