diff options
Diffstat (limited to 'openpgp/examples/sign-detached.rs')
-rw-r--r-- | openpgp/examples/sign-detached.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/openpgp/examples/sign-detached.rs b/openpgp/examples/sign-detached.rs index 2d576808..a185cef9 100644 --- a/openpgp/examples/sign-detached.rs +++ b/openpgp/examples/sign-detached.rs @@ -54,11 +54,11 @@ fn main() { // Compose a writer stack corresponding to the output format and // packet structure we want. First, we want the output to be // ASCII armored. - let sink = armor::Writer::new(io::stdout(), armor::Kind::Signature, &[]) + let mut sink = armor::Writer::new(io::stdout(), armor::Kind::Signature, &[]) .expect("Failed to create armored writer."); // Stream an OpenPGP message. - let message = Message::new(sink); + let message = Message::new(&mut sink); // Now, create a signer that emits the detached signature(s). let mut signer = @@ -76,4 +76,8 @@ fn main() { // Finally, teardown the stack to ensure all the data is written. signer.finalize() .expect("Failed to write data"); + + // Finalize the armor writer. + sink.finalize() + .expect("Failed to write data"); } |