diff options
author | Azul <azul@riseup.net> | 2020-11-28 10:34:10 +0100 |
---|---|---|
committer | Azul <azul@riseup.net> | 2020-12-01 16:23:30 +0100 |
commit | 47dd56257e024aa813ed40bd1a207a9974d3207a (patch) | |
tree | eb33111bca9a773ac3049da42b465485d62c5948 /openpgp/src/cert.rs | |
parent | 5c0cd1775fadc46e68a24a5af3d1f06803d69c4b (diff) |
openpgp: take ownership of Features bitfield
- Since `set_features` requires ownership of `Features`, it should take
ownership rather than borrowing and cloning them.
See https://rust-lang.github.io/api-guidelines/flexibility.html#caller-decides-where-to-copy-and-place-data-c-caller-control .
- See #616.
Diffstat (limited to 'openpgp/src/cert.rs')
-rw-r--r-- | openpgp/src/cert.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/openpgp/src/cert.rs b/openpgp/src/cert.rs index 2e25ad62..bc274021 100644 --- a/openpgp/src/cert.rs +++ b/openpgp/src/cert.rs @@ -4433,7 +4433,7 @@ mod test { let mut pair = key.clone().into_keypair().unwrap(); let (bind1, rev1, bind2, rev2) = { let bind1 = signature::SignatureBuilder::new(SignatureType::DirectKey) - .set_features(&Features::sequoia()).unwrap() + .set_features(Features::sequoia()).unwrap() .set_key_flags(KeyFlags::empty()).unwrap() .set_signature_creation_time(t1).unwrap() .set_key_validity_period(Some(time::Duration::new(10 * 52 * 7 * 24 * 60 * 60, 0))).unwrap() @@ -4447,7 +4447,7 @@ mod test { .sign_direct_key(&mut pair, key.parts_as_public()).unwrap(); let bind2 = signature::SignatureBuilder::new(SignatureType::DirectKey) - .set_features(&Features::sequoia()).unwrap() + .set_features(Features::sequoia()).unwrap() .set_key_flags(KeyFlags::empty()).unwrap() .set_signature_creation_time(t3).unwrap() .set_key_validity_period(Some(time::Duration::new(10 * 52 * 7 * 24 * 60 * 60, 0))).unwrap() @@ -5116,7 +5116,7 @@ Pu1xwz57O4zo1VYf6TqHJzVC3OMvMUM2hhdecMUe5x6GorNaj6g= for (t, offset) in &[ (t2, 0), (t4, 0), (t3, 1 * N), (t1, 3 * N) ] { for i in 0..N { let binding = signature::SignatureBuilder::new(SignatureType::DirectKey) - .set_features(&Features::sequoia()).unwrap() + .set_features(Features::sequoia()).unwrap() .set_key_flags(KeyFlags::empty()).unwrap() .set_signature_creation_time(t1).unwrap() // Vary this... |