diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-09-21 16:35:30 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@sequoia-pgp.org> | 2021-09-30 08:31:03 +0300 |
commit | 75b5b3fbbf8c33d10fd30e21f645b8ef1513363a (patch) | |
tree | 733b695659c128cae980c8ebbdc05966038e5707 /openpgp/src/parse.rs | |
parent | 795b89ae024d3d49a6f08283184b22770e160317 (diff) |
Improve error message for a malformed packet
Suggested by Neal Walfield.
Found by clippy lint useless_format:
https://rust-lang.github.io/rust-clippy/master/index.html#useless_format
Diffstat (limited to 'openpgp/src/parse.rs')
-rw-r--r-- | openpgp/src/parse.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/openpgp/src/parse.rs b/openpgp/src/parse.rs index 549b94f2..eacded35 100644 --- a/openpgp/src/parse.rs +++ b/openpgp/src/parse.rs @@ -5185,11 +5185,11 @@ impl<'a> PacketParser<'a> { if self.content_was_read { return Err(Error::InvalidOperation( - format!("Packet's content has already been read.")).into()); + "Packet's content has already been read.".to_string()).into()); } if ! self.encrypted { return Err(Error::InvalidOperation( - format!("Packet not encrypted.")).into()); + "Packet not encrypted.".to_string()).into()); } if algo.key_size()? != key.len () { |