diff options
Diffstat (limited to 'openpgp/examples/wrap-literal.rs')
-rw-r--r-- | openpgp/examples/wrap-literal.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/openpgp/examples/wrap-literal.rs b/openpgp/examples/wrap-literal.rs index 567ba3b5..07cad384 100644 --- a/openpgp/examples/wrap-literal.rs +++ b/openpgp/examples/wrap-literal.rs @@ -20,11 +20,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::Message, &[]) + let mut sink = armor::Writer::new(io::stdout(), armor::Kind::Message, &[]) .expect("Failed to create armored writer."); // Stream an OpenPGP message. - let message = Message::new(sink); + let message = Message::new(&mut sink); // Then, create a literal writer to wrap the data in a literal // message packet. @@ -38,4 +38,8 @@ fn main() { // Finally, teardown the stack to ensure all the data is written. literal.finalize() .expect("Failed to write data"); + + // Finalize the armor writer. + sink.finalize() + .expect("Failed to write data"); } |