Skip to content

Commit de5f7cf

Browse files
committed
ed25519: fixup clippy warning
1 parent 3991e09 commit de5f7cf

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

ed25519/src/pkcs8.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,7 @@ pub use pkcs8::der::{
3030
use core::fmt;
3131

3232
#[cfg(feature = "pem")]
33-
use {
34-
alloc::string::{String, ToString},
35-
core::str,
36-
};
33+
use core::str;
3734

3835
#[cfg(feature = "zeroize")]
3936
use zeroize::Zeroize;
@@ -323,10 +320,13 @@ impl str::FromStr for PublicKeyBytes {
323320
}
324321

325322
#[cfg(feature = "pem")]
326-
impl ToString for PublicKeyBytes {
327-
fn to_string(&self) -> String {
328-
self.to_public_key_pem(Default::default())
329-
.expect("PEM serialization error")
323+
impl fmt::Display for PublicKeyBytes {
324+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
325+
f.write_str(
326+
&self
327+
.to_public_key_pem(Default::default())
328+
.expect("PEM serialization error"),
329+
)
330330
}
331331
}
332332

0 commit comments

Comments
 (0)