diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2020-02-04 16:51:27 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2020-02-05 11:42:51 +0100 |
commit | 8d662becb65d3da9439a7fe1445ed6335d5637bf (patch) | |
tree | ad5db8d1a86c8d56be891b2bbd532ae48d023d64 /openpgp-ffi/src/armor.rs | |
parent | 37831e50a7b0a88da65061f7baf6685effe81c3d (diff) |
openpgp-ffi: Specialize armor writers.
Diffstat (limited to 'openpgp-ffi/src/armor.rs')
-rw-r--r-- | openpgp-ffi/src/armor.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/openpgp-ffi/src/armor.rs b/openpgp-ffi/src/armor.rs index f0da2905..c4f428e4 100644 --- a/openpgp-ffi/src/armor.rs +++ b/openpgp-ffi/src/armor.rs @@ -7,13 +7,12 @@ use std::mem::size_of; use std::ptr; use std::slice; -use std::io; use libc::{self, c_char, c_int, size_t}; extern crate sequoia_openpgp; use self::sequoia_openpgp::armor; -use super::io::{Reader, ReaderKind}; +use super::io::{Reader, ReaderKind, WriterKind}; use crate::Maybe; use crate::MoveIntoRaw; use crate::MoveResultIntoRaw; @@ -386,7 +385,7 @@ pub extern "C" fn pgp_armor_writer_new header_.iter().map(|h| (h.0.as_ref(), h.1.as_ref())).collect(); armor::Writer::new(inner, kind, &header) - .map(|w| -> Box<dyn io::Write> { Box::new(w) }) + .map(|w| WriterKind::Armored(w)) .map_err(|e| ::failure::Error::from(e)) .move_into_raw(errp) } |