summaryrefslogtreecommitdiffstats
path: root/openpgp/examples/sign.rs
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2018-07-04 12:57:22 +0200
committerJustus Winter <justus@sequoia-pgp.org>2018-07-04 14:39:49 +0200
commit222016e57c31135315d643c36c9328271c3bf19c (patch)
treefe03e8a06b6707a837a2d14bb3c450b166fc8e73 /openpgp/examples/sign.rs
parent5110f999bdb76b93e8e2b10328f6c3e3c06e09ed (diff)
openpgp: Hide the `writer::Stackable` trait.
- Do not expose the `writer::Stackable` trait in the API. Instead, use a tuple struct to wrap boxed objects of this kind. - Add and use `writer::Stack::finalize()` and `writer::Stack::finalize_all()` to pop one or all writers from the stack.
Diffstat (limited to 'openpgp/examples/sign.rs')
-rw-r--r--openpgp/examples/sign.rs9
1 files changed, 2 insertions, 7 deletions
diff --git a/openpgp/examples/sign.rs b/openpgp/examples/sign.rs
index f1b8282d..2e212c78 100644
--- a/openpgp/examples/sign.rs
+++ b/openpgp/examples/sign.rs
@@ -45,11 +45,6 @@ fn main() {
.expect("Failed to sign data");
// Teardown the stack to ensure all the data is written.
- let signer = literal.into_inner()
- .expect("Failed to write data")
- .unwrap();
-
- let _ = signer.into_inner()
- .expect("Failed to write data")
- .unwrap();
+ literal.finalize_all()
+ .expect("Failed to write data");
}