diff options
Diffstat (limited to 'openpgp/src/packet')
-rw-r--r-- | openpgp/src/packet/signature.rs | 10 | ||||
-rw-r--r-- | openpgp/src/packet/signature/subpacket.rs | 12 |
2 files changed, 11 insertions, 11 deletions
diff --git a/openpgp/src/packet/signature.rs b/openpgp/src/packet/signature.rs index 5b903114..079d09d1 100644 --- a/openpgp/src/packet/signature.rs +++ b/openpgp/src/packet/signature.rs @@ -3379,13 +3379,13 @@ mod test { let mut primary_signer = alice.primary_key().key().clone() .parts_into_secret()?.into_keypair()?; assert_eq!(alice.userids().len(), 1); - assert_eq!(alice.userids().nth(0).unwrap().self_signatures().len(), 1); + assert_eq!(alice.userids().nth(0).unwrap().self_signatures().count(), 1); let creation_time = - alice.userids().nth(0).unwrap().self_signatures()[0] + alice.userids().nth(0).unwrap().self_signatures().nth(0).unwrap() .signature_creation_time().unwrap(); for i in 0..2 * SIG_BACKDATE_BY { - assert_eq!(alice.userids().nth(0).unwrap().self_signatures().len(), + assert_eq!(alice.userids().nth(0).unwrap().self_signatures().count(), 1 + i as usize); // Get the binding signature so that we can modify it. @@ -3474,11 +3474,11 @@ mod test { assert_eq!(cert.bad_signatures().count(), 1); assert_eq!(cert.keys().subkeys().count(), 1); let subkey = cert.keys().subkeys().nth(0).unwrap(); - assert_eq!(subkey.self_signatures().len(), 1); + assert_eq!(subkey.self_signatures().count(), 1); // All the authentic information in the self signature has // been authenticated by the verification process. - let sig = &subkey.self_signatures()[0]; + let sig = &subkey.self_signatures().nth(0).unwrap(); assert!(sig.hashed_area().iter().all(|p| p.authenticated())); // All but our fake issuer information. assert!(sig.unhashed_area().iter().all(|p| { diff --git a/openpgp/src/packet/signature/subpacket.rs b/openpgp/src/packet/signature/subpacket.rs index 35c37b09..d97593c0 100644 --- a/openpgp/src/packet/signature/subpacket.rs +++ b/openpgp/src/packet/signature/subpacket.rs @@ -4393,7 +4393,7 @@ impl signature::SignatureBuilder { /// // Merge in the new signature. /// let bob = bob.insert_packets(certification)?; /// # assert_eq!(bob.bad_signatures().count(), 0); - /// # assert_eq!(bob.userids().nth(0).unwrap().certifications().len(), 1); + /// # assert_eq!(bob.userids().nth(0).unwrap().certifications().count(), 1); /// # Ok(()) } /// ``` pub fn set_exportable_certification(mut self, exportable: bool) @@ -4474,7 +4474,7 @@ impl signature::SignatureBuilder { /// // Merge in the new signature. /// let bob = bob.insert_packets(certification)?; /// # assert_eq!(bob.bad_signatures().count(), 0); - /// # assert_eq!(bob.userids().nth(0).unwrap().certifications().len(), 1); + /// # assert_eq!(bob.userids().nth(0).unwrap().certifications().count(), 1); /// # Ok(()) } /// ``` pub fn set_trust_signature(mut self, level: u8, trust: u8) @@ -4568,7 +4568,7 @@ impl signature::SignatureBuilder { /// // Merge in the new signature. /// let example_com = example_com.insert_packets(certification)?; /// # assert_eq!(example_com.bad_signatures().count(), 0); - /// # assert_eq!(example_com.userids().nth(0).unwrap().certifications().len(), 1); + /// # assert_eq!(example_com.userids().nth(0).unwrap().certifications().count(), 1); /// # Ok(()) } /// ``` pub fn set_regular_expression<R>(mut self, re: R) -> Result<Self> @@ -4665,7 +4665,7 @@ impl signature::SignatureBuilder { /// // Merge in the new signature. /// let example_com = example_com.insert_packets(certification)?; /// # assert_eq!(example_com.bad_signatures().count(), 0); - /// # assert_eq!(example_com.userids().nth(0).unwrap().certifications().len(), 1); + /// # assert_eq!(example_com.userids().nth(0).unwrap().certifications().count(), 1); /// # Ok(()) } /// ``` pub fn add_regular_expression<R>(mut self, re: R) -> Result<Self> @@ -4747,7 +4747,7 @@ impl signature::SignatureBuilder { /// // Merge in the new signature. /// let bob = bob.insert_packets(certification)?; /// # assert_eq!(bob.bad_signatures().count(), 0); - /// # assert_eq!(bob.userids().nth(0).unwrap().certifications().len(), 1); + /// # assert_eq!(bob.userids().nth(0).unwrap().certifications().count(), 1); /// # Ok(()) } /// ``` pub fn set_revocable(mut self, revocable: bool) -> Result<Self> { @@ -5127,7 +5127,7 @@ impl signature::SignatureBuilder { /// // Merge in the new signature. /// let alice = alice.insert_packets(sig)?; /// # assert_eq!(alice.bad_signatures().count(), 0); - /// # assert_eq!(alice.primary_key().self_signatures().len(), 2); + /// # assert_eq!(alice.primary_key().self_signatures().count(), 2); /// # Ok(()) } /// ``` pub fn set_revocation_key(mut self, rk: Vec<RevocationKey>) -> Result<Self> { |