diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2020-04-09 16:42:59 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2020-04-09 18:18:30 +0200 |
commit | 2e1eec5fe4157a391a13554ff7df3075cfe043cc (patch) | |
tree | 03ac579ba58d27c08a7ac16ca16f687d1a9456ed /guide | |
parent | c1516c59709fa47d13100daddb57657008a793c3 (diff) |
openpgp: Make PacketParserResult a std::result::Result.
- This avoids the partial implementation imitating
std::option::Option, replacing it with std::result::Result.
- As a benefit, std::result::Result is in the prelude, simplifying a
lot of parsing loops.
Diffstat (limited to 'guide')
-rw-r--r-- | guide/src/chapter_03.md | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/guide/src/chapter_03.md b/guide/src/chapter_03.md index 19a42147..d661f7b9 100644 --- a/guide/src/chapter_03.md +++ b/guide/src/chapter_03.md @@ -201,7 +201,7 @@ fn main() { let mut buf = vec![0; 1024 * 1024]; let mut ppr = PacketParser::from_bytes(MESSAGE.as_bytes()).unwrap(); - while let PacketParserResult::Some(mut pp) = ppr { + while let Ok(mut pp) = ppr { // Match on the kind of packet here while it is in the parser. if let openpgp::Packet::Literal(_) = pp.packet { // Stream the content of the literal packet. |