diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2020-12-08 16:50:44 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2020-12-08 16:50:44 +0100 |
commit | 906a248f2a538650db0c41ec180c0ba4b1568ba6 (patch) | |
tree | a7a94b2ca42bd988af2d577cb88d59578afbd636 /openpgp/src/cert.rs | |
parent | e9439f7c4b902265d3f599c224e5e5ac9798014e (diff) |
openpgp: Make unnamed iterators Send + Sync.
- See #615.
Diffstat (limited to 'openpgp/src/cert.rs')
-rw-r--r-- | openpgp/src/cert.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/openpgp/src/cert.rs b/openpgp/src/cert.rs index 39a1f293..a184558e 100644 --- a/openpgp/src/cert.rs +++ b/openpgp/src/cert.rs @@ -1223,7 +1223,8 @@ impl Cert { /// # Ok(()) /// # } /// ``` - pub fn bad_signatures(&self) -> impl Iterator<Item = &Signature> { + pub fn bad_signatures(&self) + -> impl Iterator<Item = &Signature> + Send + Sync { self.bad.iter() } @@ -1313,9 +1314,9 @@ impl Cert { /// # Ok(()) /// # } /// ``` - pub fn into_packets(self) -> impl Iterator<Item=Packet> { - fn rewrite(mut p: impl Iterator<Item=Packet>) - -> impl Iterator<Item=Packet> + pub fn into_packets(self) -> impl Iterator<Item=Packet> + Send + Sync { + fn rewrite(mut p: impl Iterator<Item=Packet> + Send + Sync) + -> impl Iterator<Item=Packet> + Send + Sync { let k: Packet = match p.next().unwrap() { Packet::PublicKey(k) => { |