@@ -160,7 +160,7 @@ impl Command {
160160 let text = serde_json:: to_string ( & PrettyBaseInfo ( info) )
161161 . context ( "Failed to serialize data" ) ?;
162162
163- println ! ( "{}" , text ) ;
163+ println ! ( "{text}" ) ;
164164 }
165165
166166 Ok ( ( ) )
@@ -172,7 +172,7 @@ impl Command {
172172 . get_device_mode ( )
173173 . context ( "Failed to get device mode" ) ?;
174174
175- println ! ( "{}" , mode ) ;
175+ println ! ( "{mode}" ) ;
176176 Ok ( ( ) )
177177 }
178178
@@ -182,7 +182,7 @@ impl Command {
182182 . get_latch_status ( )
183183 . context ( "Failed to get latch status" ) ?;
184184
185- println ! ( "{}" , status ) ;
185+ println ! ( "{status}" ) ;
186186 Ok ( ( ) )
187187 }
188188
@@ -207,7 +207,7 @@ impl Command {
207207 let text = serde_json:: to_string ( & PrettyEvent ( event) )
208208 . context ( "Failed to serialize data" ) ?;
209209
210- println ! ( "{}" , text ) ;
210+ println ! ( "{text}" ) ;
211211 }
212212 }
213213
@@ -369,9 +369,9 @@ impl std::fmt::Display for PrettyEvent {
369369 write ! ( f, "Cancel {{ Reason: " ) ?;
370370
371371 match reason {
372- CancelReason :: Hardware ( err) => write ! ( f, "\" {}\" " , err ) ,
373- CancelReason :: Runtime ( err) => write ! ( f, "\" {}\" " , err ) ,
374- CancelReason :: Unknown ( err) => write ! ( f, "{:#04x}" , err ) ,
372+ CancelReason :: Hardware ( err) => write ! ( f, "\" {err }\" " ) ,
373+ CancelReason :: Runtime ( err) => write ! ( f, "\" {err }\" " ) ,
374+ CancelReason :: Unknown ( err) => write ! ( f, "{err :#04x}" ) ,
375375 } ?;
376376
377377 write ! ( f, " }}" )
@@ -384,18 +384,18 @@ impl std::fmt::Display for PrettyEvent {
384384 BaseState :: Detached => write ! ( f, "Detached" ) ,
385385 BaseState :: Attached => write ! ( f, "Attached" ) ,
386386 BaseState :: NotFeasible => write ! ( f, "NotFeasible" ) ,
387- BaseState :: Unknown ( x) => write ! ( f, "{:#04x}" , x ) ,
387+ BaseState :: Unknown ( x) => write ! ( f, "{x :#04x}" ) ,
388388 } ?;
389389
390390 write ! ( f, ", DeviceType: " ) ?;
391391
392392 match device_type {
393393 DeviceType :: Hid => write ! ( f, "Hid" ) ,
394394 DeviceType :: Ssh => write ! ( f, "Ssh" ) ,
395- DeviceType :: Unknown ( x) => write ! ( f, "{:#04x}" , x ) ,
395+ DeviceType :: Unknown ( x) => write ! ( f, "{x :#04x}" ) ,
396396 } ?;
397397
398- write ! ( f, ", Id: {:#04x} }}" , id )
398+ write ! ( f, ", Id: {id :#04x} }}" )
399399 } ,
400400
401401 Event :: LatchStatus { status } => {
@@ -404,8 +404,8 @@ impl std::fmt::Display for PrettyEvent {
404404 match status {
405405 LatchStatus :: Closed => write ! ( f, "Closed" ) ,
406406 LatchStatus :: Opened => write ! ( f, "Opened" ) ,
407- LatchStatus :: Error ( err) => write ! ( f, "\" Error: {}\" " , err ) ,
408- LatchStatus :: Unknown ( x) => write ! ( f, "{:#04x}" , x ) ,
407+ LatchStatus :: Error ( err) => write ! ( f, "\" Error: {err }\" " ) ,
408+ LatchStatus :: Unknown ( x) => write ! ( f, "{x :#04x}" ) ,
409409 } ?;
410410
411411 write ! ( f, " }}" )
@@ -418,14 +418,14 @@ impl std::fmt::Display for PrettyEvent {
418418 DeviceMode :: Tablet => write ! ( f, "Tablet" ) ,
419419 DeviceMode :: Laptop => write ! ( f, "Laptop" ) ,
420420 DeviceMode :: Studio => write ! ( f, "Studio" ) ,
421- DeviceMode :: Unknown ( x) => write ! ( f, "{:#04x}" , x ) ,
421+ DeviceMode :: Unknown ( x) => write ! ( f, "{x :#04x}" ) ,
422422 } ?;
423423
424424 write ! ( f, " }}" )
425425 } ,
426426
427427 Event :: Unknown { code, data } => {
428- write ! ( f, "Unknown {{ Code: {:#04x}, Data: {:02x?} }}" , code , data )
428+ write ! ( f, "Unknown {{ Code: {code :#04x}, Data: {data :02x?} }}" )
429429 } ,
430430 }
431431 }
0 commit comments