summaryrefslogtreecommitdiffstats
path: root/openpgp/src/parse
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2023-03-06 20:40:29 +0100
committerJustus Winter <justus@sequoia-pgp.org>2023-03-06 22:30:32 +0100
commitdd6fb556fa557e79b167d43b021e45c35db57821 (patch)
tree2a364251e22591bebe417b62b2d4392b158540a0 /openpgp/src/parse
parentf5a7570907f96abce918b5f0d723673773139b7b (diff)
openpgp: Eagerly erase type in the PacketHeaderParser.
- The PacketHeaderParser returns erased BufferedReaders anyway, so we might as well do it early. This avoids any accidental specialization and hence code duplication.
Diffstat (limited to 'openpgp/src/parse')
-rw-r--r--openpgp/src/parse/mpis.rs26
1 files changed, 13 insertions, 13 deletions
diff --git a/openpgp/src/parse/mpis.rs b/openpgp/src/parse/mpis.rs
index f03eb097..504f08ce 100644
--- a/openpgp/src/parse/mpis.rs
+++ b/openpgp/src/parse/mpis.rs
@@ -26,7 +26,7 @@ impl mpi::PublicKey {
{
let bio = buffered_reader::Generic::with_cookie(
reader, None, Cookie::default());
- let mut php = PacketHeaderParser::new_naked(bio);
+ let mut php = PacketHeaderParser::new_naked(bio.as_boxed());
Self::_parse(algo, &mut php)
}
@@ -35,9 +35,9 @@ impl mpi::PublicKey {
/// See [Section 3.2 of RFC 4880] for details.
///
/// [Section 3.2 of RFC 4880]: https://tools.ietf.org/html/rfc4880#section-3.2
- pub(crate) fn _parse<'a, T: 'a + BufferedReader<Cookie>>(
+ pub(crate) fn _parse(
algo: PublicKeyAlgorithm,
- php: &mut PacketHeaderParser<T>)
+ php: &mut PacketHeaderParser<'_>)
-> Result<Self>
{
use crate::PublicKeyAlgorithm::*;
@@ -157,7 +157,7 @@ impl mpi::SecretKeyMaterial {
-> Result<Self> {
let bio = buffered_reader::Generic::with_cookie(
reader, None, Cookie::default());
- let mut php = PacketHeaderParser::new_naked(bio);
+ let mut php = PacketHeaderParser::new_naked(bio.as_boxed());
Self::_parse(algo, &mut php, Some(checksum))
}
@@ -170,7 +170,7 @@ impl mpi::SecretKeyMaterial {
{
let bio = buffered_reader::Generic::with_cookie(
reader, None, Cookie::default());
- let mut php = PacketHeaderParser::new_naked(bio);
+ let mut php = PacketHeaderParser::new_naked(bio.as_boxed());
Self::_parse(algo, &mut php, None)
}
@@ -179,9 +179,9 @@ impl mpi::SecretKeyMaterial {
/// See [Section 3.2 of RFC 4880] for details.
///
/// [Section 3.2 of RFC 4880]: https://tools.ietf.org/html/rfc4880#section-3.2
- pub(crate) fn _parse<'a, T: 'a + BufferedReader<Cookie>>(
+ pub(crate) fn _parse(
algo: PublicKeyAlgorithm,
- php: &mut PacketHeaderParser<T>,
+ php: &mut PacketHeaderParser<'_>,
checksum: Option<mpi::SecretKeyChecksum>,
)
-> Result<Self>
@@ -309,7 +309,7 @@ impl mpi::Ciphertext {
{
let bio = buffered_reader::Generic::with_cookie(
reader, None, Cookie::default());
- let mut php = PacketHeaderParser::new_naked(bio);
+ let mut php = PacketHeaderParser::new_naked(bio.as_boxed());
Self::_parse(algo, &mut php)
}
@@ -319,9 +319,9 @@ impl mpi::Ciphertext {
/// See [Section 3.2 of RFC 4880] for details.
///
/// [Section 3.2 of RFC 4880]: https://tools.ietf.org/html/rfc4880#section-3.2
- pub(crate) fn _parse<'a, T: 'a + BufferedReader<Cookie>>(
+ pub(crate) fn _parse(
algo: PublicKeyAlgorithm,
- php: &mut PacketHeaderParser<T>)
+ php: &mut PacketHeaderParser<'_>)
-> Result<Self> {
use crate::PublicKeyAlgorithm::*;
@@ -388,7 +388,7 @@ impl mpi::Signature {
{
let bio = buffered_reader::Generic::with_cookie(
reader, None, Cookie::default());
- let mut php = PacketHeaderParser::new_naked(bio);
+ let mut php = PacketHeaderParser::new_naked(bio.as_boxed());
Self::_parse(algo, &mut php)
}
@@ -398,9 +398,9 @@ impl mpi::Signature {
/// See [Section 3.2 of RFC 4880] for details.
///
/// [Section 3.2 of RFC 4880]: https://tools.ietf.org/html/rfc4880#section-3.2
- pub(crate) fn _parse<'a, T: 'a + BufferedReader<Cookie>>(
+ pub(crate) fn _parse(
algo: PublicKeyAlgorithm,
- php: &mut PacketHeaderParser<T>)
+ php: &mut PacketHeaderParser<'_>)
-> Result<Self> {
use crate::PublicKeyAlgorithm::*;