diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2020-10-22 16:34:47 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2020-10-22 16:43:51 +0200 |
commit | 731f01cf5f3699ab738333a65a541d3fb2f25e15 (patch) | |
tree | 6e43d2b9f6a9488a0e2d89afebfd8a756325a402 /openpgp/src/parse | |
parent | c677bae2a7d0875c430eb641ec7601398ced9b14 (diff) |
openpgp: Introduce symbol for the magic value.
Diffstat (limited to 'openpgp/src/parse')
-rw-r--r-- | openpgp/src/parse/packet_parser_builder.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/openpgp/src/parse/packet_parser_builder.rs b/openpgp/src/parse/packet_parser_builder.rs index a3a14e22..344dbd3f 100644 --- a/openpgp/src/parse/packet_parser_builder.rs +++ b/openpgp/src/parse/packet_parser_builder.rs @@ -58,6 +58,10 @@ impl Default for Dearmor { } } +/// This is the level at which we insert the dearmoring filter into +/// the buffered reader stack. +pub(super) const ARMOR_READER_LEVEL: isize = -2; + /// A builder for configuring a `PacketParser`. /// /// Since the default settings are usually appropriate, this mechanism @@ -419,7 +423,7 @@ impl<'a> PacketParserBuilder<'a> { // the packet parser is finished. We use level -2 for that. self.bio = armor::Reader::from_buffered_reader(self.bio, Some(mode), - Cookie::new(-2)) + Cookie::new(ARMOR_READER_LEVEL)) .as_boxed(); } |