summaryrefslogtreecommitdiffstats
path: root/openpgp/src/serialize
diff options
context:
space:
mode:
Diffstat (limited to 'openpgp/src/serialize')
-rw-r--r--openpgp/src/serialize/stream.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/openpgp/src/serialize/stream.rs b/openpgp/src/serialize/stream.rs
index 0a6c0851..a913684a 100644
--- a/openpgp/src/serialize/stream.rs
+++ b/openpgp/src/serialize/stream.rs
@@ -1770,6 +1770,11 @@ impl<'a> Recipient<'a> {
/// will be encrypted using the given passwords, and for all given
/// recipients.
pub struct Encryptor<'a> {
+ // XXX: Opportunity for optimization. Previously, this writer
+ // implemented `Drop`, so we could not move the inner writer out
+ // of this writer. We therefore wrapped it with `Option` so that
+ // we can `take()` it. This writer no longer implements Drop, so
+ // we could avoid the Option here.
inner: Option<writer::BoxStack<'a, Cookie>>,
recipients: Vec<Recipient<'a>>,
passwords: Vec<Password>,
@@ -2314,12 +2319,6 @@ impl<'a> Encryptor<'a> {
}
}
-impl<'a> Drop for Encryptor<'a> {
- fn drop(&mut self) {
- let _ = self.emit_mdc();
- }
-}
-
impl<'a> fmt::Debug for Encryptor<'a> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("Encryptor")