Skip to content

Commit

Permalink
fix: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
oleonardolima committed May 24, 2024
1 parent cce97ac commit d675ae2
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,17 +260,28 @@ where
}
}

impl ToString for HWIDeviceType {
fn to_string(&self) -> String {
struct Point {
x: usize,
y: usize,
}

impl std::fmt::Display for Point {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "({}, {})", self.x, self.y)
}
}

impl std::fmt::Display for HWIDeviceType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::Ledger => String::from("ledger"),
Self::Trezor => String::from("trezor"),
Self::BitBox01 => String::from("digitalbitbox"),
Self::BitBox02 => String::from("bitbox02"),
Self::KeepKey => String::from("keepkey"),
Self::Coldcard => String::from("coldcard"),
Self::Jade => String::from("jade"),
Self::Other(name) => name.to_string(),
HWIDeviceType::Ledger => write!(f, "ledger"),
HWIDeviceType::Trezor => write!(f, "trezor"),
HWIDeviceType::BitBox01 => write!(f, "digitalbitbox"),
HWIDeviceType::BitBox02 => write!(f, "bitbox02"),
HWIDeviceType::KeepKey => write!(f, "keepkey"),
HWIDeviceType::Coldcard => write!(f, "coldcard"),
HWIDeviceType::Jade => write!(f, "jade"),
HWIDeviceType::Other(name) => write!(f, "{}", name.to_string()),
}
}
}
Expand Down

0 comments on commit d675ae2

Please sign in to comment.