diff options
author | Nora Widdecke <nora@sequoia-pgp.org> | 2021-04-06 21:24:59 +0200 |
---|---|---|
committer | Nora Widdecke <nora@sequoia-pgp.org> | 2021-04-09 13:13:58 +0200 |
commit | 5d029cbf42621452666bd084f7beecb7d3d885a4 (patch) | |
tree | 21219c5864beac97ff5c55c78b436918034adcd6 /openpgp/src/parse.rs | |
parent | 9424cd350f32a97479a74d919c646f9e26c2ebce (diff) |
Lint: Remove unnecessary conversions.
- https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
Diffstat (limited to 'openpgp/src/parse.rs')
-rw-r--r-- | openpgp/src/parse.rs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/openpgp/src/parse.rs b/openpgp/src/parse.rs index c077e81d..30593e82 100644 --- a/openpgp/src/parse.rs +++ b/openpgp/src/parse.rs @@ -1352,7 +1352,7 @@ impl Signature4 { let typ = typ.into(); let need_hash = HashingMode::for_signature(hash_algo, typ); let mut pp = php.ok(Packet::Signature(Signature4::new( - typ, pk_algo.into(), hash_algo, + typ, pk_algo, hash_algo, hashed_area, unhashed_area, [digest_prefix1, digest_prefix2], @@ -1455,8 +1455,7 @@ impl Signature4 { return Err( Error::MalformedPacket( format!("Unexpected body length encoding: {:?}", - header.length()) - .into()).into()); + header.length())).into()); } // Make sure we have a minimum header. @@ -2256,14 +2255,13 @@ impl Key4<key::UnspecifiedParts, key::UnspecifiedRole> if len < 6 { // Much too short. return Err(Error::MalformedPacket( - format!("Packet too short ({} bytes)", len).into()).into()); + format!("Packet too short ({} bytes)", len)).into()); } } else { return Err( Error::MalformedPacket( format!("Unexpected body length encoding: {:?}", - header.length()) - .into()).into()); + header.length())).into()); } // Make sure we have a minimum header. @@ -2373,7 +2371,7 @@ impl Marker { } else { return Err(Error::MalformedPacket( format!("Unexpected body length encoding: {:?}", - header.length()).into()).into()); + header.length())).into()); } // Check the body. @@ -4224,7 +4222,7 @@ impl <'a> PacketParser<'a> { } Err(err) => { if orig_error.is_none() { - orig_error = Some(err.into()); + orig_error = Some(err); } if state.first_packet || skip > 32 * 1024 { |