diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2022-06-27 18:38:27 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2022-06-27 18:38:27 +0200 |
commit | 16b5a1228990f53574f3b2d9d2a4143163e7cd91 (patch) | |
tree | b0616a0a7b6cdd96ce5e01f8e7fcca6038f29fce /openpgp/src/cert.rs | |
parent | bf379501a681e42dabaf91a66490e0069d082c0a (diff) |
openpgp: Make Cert::insert_packets_merge take a FnMut.
- This way, the callback can have side-effects.
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 053220bd..135d7d90 100644 --- a/openpgp/src/cert.rs +++ b/openpgp/src/cert.rs @@ -2602,7 +2602,7 @@ impl Cert { -> Result<(Self, bool)> where P: IntoIterator, P::Item: Into<Packet>, - I: Fn(Option<Packet>, Packet) -> Result<Packet>, + I: FnMut(Option<Packet>, Packet) -> Result<Packet>, { self.insert_packets_(&mut packets.into_iter().map(Into::into), Box::new(merge)) @@ -2615,8 +2615,8 @@ impl Cert { /// we avoid the cost of monomorphization. fn insert_packets_<'a>(self, packets: &mut dyn Iterator<Item = Packet>, - merge: Box<dyn Fn(Option<Packet>, Packet) - -> Result<Packet> + 'a>) + mut merge: Box<dyn FnMut(Option<Packet>, Packet) + -> Result<Packet> + 'a>) -> Result<(Self, bool)> { let mut changed = false; |