diff options
Diffstat (limited to 'openpgp/examples/wrap-literal.rs')
-rw-r--r-- | openpgp/examples/wrap-literal.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/openpgp/examples/wrap-literal.rs b/openpgp/examples/wrap-literal.rs index b7cea74e..9d9560e3 100644 --- a/openpgp/examples/wrap-literal.rs +++ b/openpgp/examples/wrap-literal.rs @@ -9,7 +9,7 @@ use std::io; extern crate openpgp; use openpgp::armor; use openpgp::constants::DataFormat; -use openpgp::serialize::stream::{wrap, LiteralWriter}; +use openpgp::serialize::stream::{Message, LiteralWriter}; fn main() { let args: Vec<String> = env::args().collect(); @@ -24,9 +24,12 @@ fn main() { let sink = armor::Writer::new(io::stdout(), armor::Kind::Message, &[][..]) .expect("Failed to create armored writer."); + // Stream an OpenPGP message. + let message = Message::new(sink); + // Then, create a literal writer to wrap the data in a literal // message packet. - let mut literal = LiteralWriter::new(wrap(sink), DataFormat::Binary, + let mut literal = LiteralWriter::new(message, DataFormat::Binary, None, None) .expect("Failed to create literal writer"); |