Skip to content

Commit c062eda

Browse files
committed
fix: clippy
1 parent cce97ac commit c062eda

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/types.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -260,17 +260,17 @@ where
260260
}
261261
}
262262

263-
impl ToString for HWIDeviceType {
264-
fn to_string(&self) -> String {
263+
impl std::fmt::Display for HWIDeviceType {
264+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
265265
match self {
266-
Self::Ledger => String::from("ledger"),
267-
Self::Trezor => String::from("trezor"),
268-
Self::BitBox01 => String::from("digitalbitbox"),
269-
Self::BitBox02 => String::from("bitbox02"),
270-
Self::KeepKey => String::from("keepkey"),
271-
Self::Coldcard => String::from("coldcard"),
272-
Self::Jade => String::from("jade"),
273-
Self::Other(name) => name.to_string(),
266+
Self::Ledger => write!(f, "ledger"),
267+
Self::Trezor => write!(f, "trezor"),
268+
Self::BitBox01 => write!(f, "digitalbitbox"),
269+
Self::BitBox02 => write!(f, "bitbox02"),
270+
Self::KeepKey => write!(f, "keepkey"),
271+
Self::Coldcard => write!(f, "coldcard"),
272+
Self::Jade => write!(f, "jade"),
273+
Self::Other(name) => write!(f, "{}", name),
274274
}
275275
}
276276
}

0 commit comments

Comments
 (0)