summaryrefslogtreecommitdiffstats
path: root/openpgp/examples/pad.rs
diff options
context:
space:
mode:
Diffstat (limited to 'openpgp/examples/pad.rs')
-rw-r--r--openpgp/examples/pad.rs10
1 files changed, 3 insertions, 7 deletions
diff --git a/openpgp/examples/pad.rs b/openpgp/examples/pad.rs
index 4a762b58..8e5915a8 100644
--- a/openpgp/examples/pad.rs
+++ b/openpgp/examples/pad.rs
@@ -38,7 +38,7 @@ fn main() {
}).collect();
// Build a vector of recipients to hand to Encryptor.
- let mut recipients = certs
+ let recipients = certs
.iter()
.flat_map(|cert| {
cert.keys()
@@ -57,12 +57,8 @@ fn main() {
let message = Message::new(&mut sink);
// We want to encrypt a literal data packet.
- let mut encryptor = Encryptor::for_recipient(
- message, recipients.pop().expect("No encryption key found"));
- for r in recipients {
- encryptor = encryptor.add_recipient(r)
- }
- let encryptor = encryptor.build().expect("Failed to create encryptor");
+ let encryptor = Encryptor::for_recipients(message, recipients)
+ .build().expect("Failed to create encryptor");
let padder = Padder::new(encryptor, padme)
.expect("Failed to create padder");