diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2020-04-20 17:15:08 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2020-04-20 18:44:00 +0200 |
commit | bc4e1564ea816a66d1191fc310ac6d2b02d1a92f (patch) | |
tree | 4ee0e4ee0706fa9cedab061fef8cffbc549b0d62 /autocrypt | |
parent | 15723e28cc6e18b0ca7a51212bbcd72fb0e40c72 (diff) |
openpgp: Add armor::Writer::with_headers.
- Add a new constructor that takes headers. This allows us to make
the header argument polymorphic.
Diffstat (limited to 'autocrypt')
-rw-r--r-- | autocrypt/src/lib.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/autocrypt/src/lib.rs b/autocrypt/src/lib.rs index 1c8de979..64b7fa58 100644 --- a/autocrypt/src/lib.rs +++ b/autocrypt/src/lib.rs @@ -482,7 +482,7 @@ impl AutocryptSetupMessage { } let mut armor_writer = - armor::Writer::new(w, armor::Kind::Message, &headers[..])?; + armor::Writer::with_headers(w, armor::Kind::Message, headers)?; { // Passphrase-Format header with value numeric9x4 @@ -493,10 +493,10 @@ impl AutocryptSetupMessage { let m = LiteralWriter::new(m).build()?; // The inner message is an ASCII-armored encoded Cert. - let mut w = armor::Writer::new( + let mut w = armor::Writer::with_headers( m, armor::Kind::SecretKey, - &[ (&"Autocrypt-Prefer-Encrypt"[..], - self.prefer_encrypt().unwrap_or(&"nopreference"[..])) ])?; + vec![("Autocrypt-Prefer-Encrypt", + self.prefer_encrypt().unwrap_or(&"nopreference"[..]))])?; self.cert.as_tsk().serialize(&mut w)?; let m = w.finalize()?; |