@@ -94,7 +94,7 @@ async fn connect(
94
94
}
95
95
Err ( err) => {
96
96
set_disconnected_prompt ( interface) ;
97
- writeln ! ( interface, "{}" , err ) . unwrap ( ) ;
97
+ writeln ! ( interface, "{err}" ) . unwrap ( ) ;
98
98
None
99
99
}
100
100
}
@@ -132,7 +132,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
132
132
133
133
let addr = std:: env:: var ( "KUKSA_DATA_BROKER_ADDR" ) . unwrap_or_else ( |_| "127.0.0.1" . to_owned ( ) ) ;
134
134
let port = std:: env:: var ( "KUKSA_DATA_BROKER_PORT" ) . unwrap_or_else ( |_| "55555" . to_owned ( ) ) ;
135
- let mut uri = match addr_to_uri ( format ! ( "{}:{}" , addr , port ) ) {
135
+ let mut uri = match addr_to_uri ( format ! ( "{addr }:{port}" ) ) {
136
136
Some ( uri) => uri,
137
137
None => return Err ( Box :: new ( ParseError { } ) . into ( ) ) ,
138
138
} ;
@@ -154,10 +154,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
154
154
let ( cmd, args) = split_first_word ( & line) ;
155
155
match cmd {
156
156
"help" => {
157
- println ! ( "{} commands:" , APP_NAME ) ;
157
+ println ! ( "{APP_NAME } commands:" ) ;
158
158
println ! ( ) ;
159
159
for & ( cmd, help) in CLI_COMMANDS {
160
- println ! ( " {:15} - {}" , cmd , help ) ;
160
+ println ! ( " {cmd :15} - {help}" ) ;
161
161
}
162
162
println ! ( ) ;
163
163
}
@@ -270,15 +270,11 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
270
270
) {
271
271
Some ( error) => {
272
272
println ! (
273
- "-> Error setting id {}: {:?}" ,
274
- id, error
273
+ "-> Error setting id {id}: {error:?}"
275
274
)
276
275
}
277
276
None => {
278
- println ! (
279
- "-> Error setting id {}" ,
280
- id
281
- )
277
+ println ! ( "-> Error setting id {id}" )
282
278
}
283
279
}
284
280
}
@@ -367,15 +363,11 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
367
363
) {
368
364
Some ( error) => {
369
365
println ! (
370
- "-> Error setting id {}: {:?}" ,
371
- id, error
366
+ "-> Error setting id {id}: {error:?}"
372
367
)
373
368
}
374
369
None => {
375
- println ! (
376
- "-> Error setting id {}" ,
377
- id
378
- )
370
+ println ! ( "-> Error setting id {id}" )
379
371
}
380
372
}
381
373
}
@@ -417,8 +409,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
417
409
tonic:: Request :: new ( proto:: v1:: SubscribeRequest { query } ) ;
418
410
match client. subscribe ( args) . await {
419
411
Ok ( response) => {
420
- let sub_id =
421
- format ! ( "subscription{}" , subscription_nbr) ;
412
+ let sub_id = format ! ( "subscription{subscription_nbr}" ) ;
422
413
subscription_nbr += 1 ;
423
414
tokio:: spawn ( async move {
424
415
let mut stream = response. into_inner ( ) ;
@@ -441,8 +432,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
441
432
}
442
433
writeln ! (
443
434
iface,
444
- "-> {}:\n {}" ,
445
- sub_id, output
435
+ "-> {sub_id}:\n {output}"
446
436
)
447
437
. unwrap ( ) ;
448
438
}
@@ -531,7 +521,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
531
521
break ;
532
522
}
533
523
ReadResult :: Signal ( sig) => {
534
- println ! ( "received signal: {:?}" , sig ) ;
524
+ println ! ( "received signal: {sig :?}" ) ;
535
525
}
536
526
}
537
527
}
@@ -778,9 +768,9 @@ where
778
768
let real_delimiter = ", " ;
779
769
let mut delimiter = "" ;
780
770
for value in array {
781
- write ! ( f, "{}" , delimiter ) ?;
771
+ write ! ( f, "{delimiter}" ) ?;
782
772
delimiter = real_delimiter;
783
- write ! ( f, "{}" , value ) ?;
773
+ write ! ( f, "{value}" ) ?;
784
774
}
785
775
f. write_str ( "]" )
786
776
}
@@ -790,32 +780,32 @@ impl fmt::Display for DisplayDatapoint {
790
780
match & self . 0 . value {
791
781
Some ( value) => match value {
792
782
proto:: v1:: datapoint:: Value :: BoolValue ( value) => {
793
- f. write_fmt ( format_args ! ( "{}" , value ) )
783
+ f. write_fmt ( format_args ! ( "{value}" ) )
794
784
}
795
785
proto:: v1:: datapoint:: Value :: FailureValue ( failure) => f. write_fmt ( format_args ! (
796
786
"( {:?} )" ,
797
787
proto:: v1:: datapoint:: Failure :: from_i32( * failure) . unwrap( )
798
788
) ) ,
799
789
proto:: v1:: datapoint:: Value :: Int32Value ( value) => {
800
- f. write_fmt ( format_args ! ( "{}" , value ) )
790
+ f. write_fmt ( format_args ! ( "{value}" ) )
801
791
}
802
792
proto:: v1:: datapoint:: Value :: Int64Value ( value) => {
803
- f. write_fmt ( format_args ! ( "{}" , value ) )
793
+ f. write_fmt ( format_args ! ( "{value}" ) )
804
794
}
805
795
proto:: v1:: datapoint:: Value :: Uint32Value ( value) => {
806
- f. write_fmt ( format_args ! ( "{}" , value ) )
796
+ f. write_fmt ( format_args ! ( "{value}" ) )
807
797
}
808
798
proto:: v1:: datapoint:: Value :: Uint64Value ( value) => {
809
- f. write_fmt ( format_args ! ( "{}" , value ) )
799
+ f. write_fmt ( format_args ! ( "{value}" ) )
810
800
}
811
801
proto:: v1:: datapoint:: Value :: FloatValue ( value) => {
812
- f. write_fmt ( format_args ! ( "{:.2}" , value ) )
802
+ f. write_fmt ( format_args ! ( "{value :.2}" ) )
813
803
}
814
804
proto:: v1:: datapoint:: Value :: DoubleValue ( value) => {
815
- f. write_fmt ( format_args ! ( "{}" , value ) )
805
+ f. write_fmt ( format_args ! ( "{value}" ) )
816
806
}
817
807
proto:: v1:: datapoint:: Value :: StringValue ( value) => {
818
- f. write_fmt ( format_args ! ( "'{}'" , value ) )
808
+ f. write_fmt ( format_args ! ( "'{value }'" ) )
819
809
}
820
810
proto:: v1:: datapoint:: Value :: StringArray ( array) => display_array ( f, & array. values ) ,
821
811
proto:: v1:: datapoint:: Value :: BoolArray ( array) => display_array ( f, & array. values ) ,
0 commit comments