From de5f7cfdf16690744fd060e7129c4ca8a346539b Mon Sep 17 00:00:00 2001 From: Arthur Gautier Date: Sat, 28 Sep 2024 20:46:34 -0700 Subject: [PATCH] ed25519: fixup clippy warning --- ed25519/src/pkcs8.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ed25519/src/pkcs8.rs b/ed25519/src/pkcs8.rs index cac2f9b2..53b45774 100644 --- a/ed25519/src/pkcs8.rs +++ b/ed25519/src/pkcs8.rs @@ -30,10 +30,7 @@ pub use pkcs8::der::{ use core::fmt; #[cfg(feature = "pem")] -use { - alloc::string::{String, ToString}, - core::str, -}; +use core::str; #[cfg(feature = "zeroize")] use zeroize::Zeroize; @@ -323,10 +320,13 @@ impl str::FromStr for PublicKeyBytes { } #[cfg(feature = "pem")] -impl ToString for PublicKeyBytes { - fn to_string(&self) -> String { - self.to_public_key_pem(Default::default()) - .expect("PEM serialization error") +impl fmt::Display for PublicKeyBytes { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.write_str( + &self + .to_public_key_pem(Default::default()) + .expect("PEM serialization error"), + ) } }