diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2018-07-04 12:57:22 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2018-07-04 14:39:49 +0200 |
commit | 222016e57c31135315d643c36c9328271c3bf19c (patch) | |
tree | fe03e8a06b6707a837a2d14bb3c450b166fc8e73 /openpgp/examples | |
parent | 5110f999bdb76b93e8e2b10328f6c3e3c06e09ed (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')
-rw-r--r-- | openpgp/examples/sign-detached.rs | 5 | ||||
-rw-r--r-- | openpgp/examples/sign.rs | 9 |
2 files changed, 4 insertions, 10 deletions
diff --git a/openpgp/examples/sign-detached.rs b/openpgp/examples/sign-detached.rs index a4052907..3bbb9abd 100644 --- a/openpgp/examples/sign-detached.rs +++ b/openpgp/examples/sign-detached.rs @@ -40,7 +40,6 @@ fn main() { .expect("Failed to sign data"); // Teardown the stack to ensure all the data is written. - let _ = signer.into_inner() - .expect("Failed to write data") - .unwrap(); + signer.finalize_all() + .expect("Failed to write data"); } 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"); } |