fix(clippy): implement idiomatic `Display` instead

This commit is contained in:
winstxnhdw 2024-06-27 04:10:39 +08:00
parent 6b49ca8db4
commit 88b4eb6b3f
No known key found for this signature in database
GPG Key ID: 28C6693A1379DAE9
1 changed files with 4 additions and 4 deletions

View File

@ -4,7 +4,7 @@
//! Helpers to tidy up the computation of digests in various places.
use std::{
fs,
fmt, fs,
path::{Path, PathBuf},
str::FromStr,
};
@ -103,9 +103,9 @@ impl DigestData {
}
}
impl ToString for DigestData {
fn to_string(&self) -> String {
bytes_to_hex(&self.0)
impl fmt::Display for DigestData {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", bytes_to_hex(&self.0))
}
}