@@ -260,17 +260,17 @@ where
260
260
}
261
261
}
262
262
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 {
265
265
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 ) ,
274
274
}
275
275
}
276
276
}
0 commit comments