summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)
}
}