diff options
-rw-r--r-- | openpgp/src/cert/parser/low_level/mod.rs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/openpgp/src/cert/parser/low_level/mod.rs b/openpgp/src/cert/parser/low_level/mod.rs index e4b2b7ad..eef79987 100644 --- a/openpgp/src/cert/parser/low_level/mod.rs +++ b/openpgp/src/cert/parser/low_level/mod.rs @@ -22,12 +22,18 @@ pub(crate) use self::grammar::CertParser; // ParseError<usize, Tag, Error>. // // Justification: a Token is a tuple containing a Tag and a Packet. -// This function essentially drops the Packet. Dropping the packet is -// necessary, because packets are not Sync, but Fail, which we want -// to convert ParseErrors to, is. Since we don't need the packet in +// This function essentially drops the Packet. Dropping the packet was +// necessary, because packets were not Sync, but Error, which we want +// to convert ParseErrors to, was. Since we don't need the packet in // general anyways, changing the Token to a Tag is a simple and // sufficient fix. Unfortunately, this conversion is a bit ugly and // will break if lalrpop ever extends ParseError. +// +// This justification is no longer up-to-date because Packet is now +// also Sync. However, we didn't catch this when we made Packet Sync, +// and now the justification is simply that CertParserError::Parser(_) +// expects a Tag, not a Packet. It is not public, so we could change +// it. pub(crate) fn parse_error_downcast(e: ParseError<usize, Token, Error>) -> ParseError<usize, Tag, Error> { |