summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2020-06-10 12:47:57 +0200
committerJustus Winter <justus@sequoia-pgp.org>2020-06-10 12:47:57 +0200
commit2f762288602ff0eb79de0a66e1e11b3be5ac1dc8 (patch)
treedf45f9cbb9617171f3365c68fccfec912e948a42
parente77dadb06655d7fa0c43c6ba2947d4745246a4d1 (diff)
openpgp: Improve Display implementations.
-rw-r--r--openpgp/src/cert/parser/low_level/lexer.rs2
-rw-r--r--openpgp/src/message/lexer.rs4
2 files changed, 3 insertions, 3 deletions
diff --git a/openpgp/src/cert/parser/low_level/lexer.rs b/openpgp/src/cert/parser/low_level/lexer.rs
index 05cfbe43..27df8b6b 100644
--- a/openpgp/src/cert/parser/low_level/lexer.rs
+++ b/openpgp/src/cert/parser/low_level/lexer.rs
@@ -127,7 +127,7 @@ impl From<Packet> for Option<Token> {
impl fmt::Display for Token {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- f.write_str(&format!("{:?}", self)[..])
+ write!(f, "{:?}", self)
}
}
diff --git a/openpgp/src/message/lexer.rs b/openpgp/src/message/lexer.rs
index 1bdc6c1f..b0a0c16b 100644
--- a/openpgp/src/message/lexer.rs
+++ b/openpgp/src/message/lexer.rs
@@ -48,7 +48,7 @@ pub enum Token {
impl fmt::Display for Token {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- f.write_str(&format!("{:?}", self)[..])
+ write!(f, "{:?}", self)
}
}
@@ -59,7 +59,7 @@ pub enum LexicalError {
impl fmt::Display for LexicalError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- f.write_str(&format!("{:?}", self)[..])
+ write!(f, "{:?}", self)
}
}