@@ -115,7 +115,7 @@ impl dtvcc_service_decoder {
115
115
let pd = match dtvcc_window_pd:: new ( window. attribs . print_direction ) {
116
116
Ok ( val) => val,
117
117
Err ( e) => {
118
- warn ! ( "{}" , e ) ;
118
+ warn ! ( "{e}" ) ;
119
119
return ;
120
120
}
121
121
} ;
@@ -218,7 +218,7 @@ impl dtvcc_service_decoder {
218
218
let pd = match dtvcc_window_pd:: new ( window. attribs . print_direction ) {
219
219
Ok ( val) => val,
220
220
Err ( e) => {
221
- warn ! ( "{}" , e ) ;
221
+ warn ! ( "{e}" ) ;
222
222
return ;
223
223
}
224
224
} ;
@@ -283,7 +283,7 @@ impl dtvcc_service_decoder {
283
283
return -1 ;
284
284
}
285
285
286
- debug ! ( "C1: [{:?}] [{}] ({})" , command , name , length ) ;
286
+ debug ! ( "C1: [{command :?}] [{name }] ({length })" ) ;
287
287
match command {
288
288
C1CodeSet :: CW0
289
289
| C1CodeSet :: CW1
@@ -344,7 +344,7 @@ impl dtvcc_service_decoder {
344
344
for i in 0 ..CCX_DTVCC_MAX_WINDOWS {
345
345
if windows_bitmap & 1 == 1 {
346
346
let window = & mut self . windows [ i as usize ] ;
347
- debug ! ( "[W{}]" , i ) ;
347
+ debug ! ( "[W{i }]" ) ;
348
348
let window_had_content = is_true ( window. is_defined )
349
349
&& is_true ( window. visible )
350
350
&& is_false ( window. is_empty ) ;
@@ -381,7 +381,7 @@ impl dtvcc_service_decoder {
381
381
for i in 0 ..CCX_DTVCC_MAX_WINDOWS {
382
382
if windows_bitmap & 1 == 1 {
383
383
let window = & mut self . windows [ i as usize ] ;
384
- debug ! ( "[W{}]" , i ) ;
384
+ debug ! ( "[W{i }]" ) ;
385
385
if is_true ( window. visible ) {
386
386
screen_content_changed = true ;
387
387
window. visible = 0 ;
@@ -418,11 +418,11 @@ impl dtvcc_service_decoder {
418
418
let window = & mut self . windows [ i as usize ] ;
419
419
if windows_bitmap & 1 == 1 && is_true ( window. is_defined ) {
420
420
if is_false ( window. visible ) {
421
- debug ! ( "[W-{}: 0->1]" , i ) ;
421
+ debug ! ( "[W-{i }: 0->1]" ) ;
422
422
window. visible = 1 ;
423
423
window. update_time_show ( timing) ;
424
424
} else {
425
- debug ! ( "[W-{}: 1->0]" , i ) ;
425
+ debug ! ( "[W-{i }: 1->0]" ) ;
426
426
window. visible = 0 ;
427
427
window. update_time_hide ( timing) ;
428
428
if is_false ( window. is_empty ) {
@@ -456,7 +456,7 @@ impl dtvcc_service_decoder {
456
456
} else {
457
457
for i in 0 ..CCX_DTVCC_MAX_WINDOWS {
458
458
if windows_bitmap & 1 == 1 {
459
- debug ! ( "Deleting [W{}]" , i ) ;
459
+ debug ! ( "Deleting [W{i }]" ) ;
460
460
let window = & mut self . windows [ i as usize ] ;
461
461
let window_had_content = is_true ( window. is_defined )
462
462
&& is_true ( window. visible )
@@ -501,9 +501,9 @@ impl dtvcc_service_decoder {
501
501
for i in 0 ..CCX_DTVCC_MAX_WINDOWS {
502
502
if windows_bitmap & 1 == 1 {
503
503
let window = & mut self . windows [ i as usize ] ;
504
- debug ! ( "[W{}]" , i ) ;
504
+ debug ! ( "[W{i }]" ) ;
505
505
if is_false ( window. is_defined ) {
506
- error ! ( "Window {} was not defined" , i ) ;
506
+ error ! ( "Window {i } was not defined" ) ;
507
507
continue ;
508
508
}
509
509
if is_false ( window. visible ) {
@@ -525,10 +525,7 @@ impl dtvcc_service_decoder {
525
525
block : & [ c_uchar ] ,
526
526
timing : & mut ccx_common_timing_ctx ,
527
527
) {
528
- debug ! (
529
- "dtvcc_handle_DFx_DefineWindow: W[{}], attributes:" ,
530
- window_id
531
- ) ;
528
+ debug ! ( "dtvcc_handle_DFx_DefineWindow: W[{window_id}], attributes:" ) ;
532
529
let window = & mut self . windows [ window_id as usize ] ;
533
530
let block = & block[ ..=5 ] ;
534
531
let is_command_repeated = window
@@ -562,12 +559,12 @@ impl dtvcc_service_decoder {
562
559
let mut do_clear_window = false ;
563
560
564
561
debug ! ( "Visible: [{}]" , if is_true( visible) { "Yes" } else { "No" } ) ;
565
- debug ! ( "Priority: [{}]" , priority ) ;
566
- debug ! ( "Row count: [{}]" , row_count ) ;
567
- debug ! ( "Column count: [{}]" , col_count ) ;
568
- debug ! ( "Anchor point: [{}]" , anchor_point ) ;
569
- debug ! ( "Anchor vertical: [{}]" , anchor_vertical ) ;
570
- debug ! ( "Anchor horizontal: [{}]" , anchor_horizontal ) ;
562
+ debug ! ( "Priority: [{priority }]" ) ;
563
+ debug ! ( "Row count: [{row_count }]" ) ;
564
+ debug ! ( "Column count: [{col_count }]" ) ;
565
+ debug ! ( "Anchor point: [{anchor_point }]" ) ;
566
+ debug ! ( "Anchor vertical: [{anchor_vertical }]" ) ;
567
+ debug ! ( "Anchor horizontal: [{anchor_horizontal }]" ) ;
571
568
debug ! (
572
569
"Relative pos: [{}]" ,
573
570
if is_true( relative_pos) { "Yes" } else { "No" }
@@ -580,8 +577,8 @@ impl dtvcc_service_decoder {
580
577
"Column lock: [{}]" ,
581
578
if is_true( col_lock) { "Yes" } else { "No" }
582
579
) ;
583
- debug ! ( "Pen style: [{}]" , pen_style ) ;
584
- debug ! ( "Win style: [{}]" , win_style ) ;
580
+ debug ! ( "Pen style: [{pen_style }]" ) ;
581
+ debug ! ( "Win style: [{win_style }]" ) ;
585
582
586
583
// Korean samples have "anchor_vertical" and "anchor_horizontal" mixed up,
587
584
// this seems to be an encoder issue, but we can workaround it
@@ -640,7 +637,7 @@ impl dtvcc_service_decoder {
640
637
for i in 0 ..CCX_DTVCC_MAX_ROWS as usize {
641
638
let layout = Layout :: array :: < dtvcc_symbol > ( CCX_DTVCC_MAX_COLUMNS as usize ) ;
642
639
if let Err ( e) = layout {
643
- error ! ( "dtvcc_handle_DFx_DefineWindow: Incorrect Layout, {}" , e ) ;
640
+ error ! ( "dtvcc_handle_DFx_DefineWindow: Incorrect Layout, {e}" ) ;
644
641
} else {
645
642
let ptr = unsafe { alloc ( layout. unwrap ( ) ) } ;
646
643
if ptr. is_null ( ) {
@@ -671,7 +668,7 @@ impl dtvcc_service_decoder {
671
668
for i in 0 ..CCX_DTVCC_MAX_ROWS as usize {
672
669
let layout = Layout :: array :: < dtvcc_symbol > ( CCX_DTVCC_MAX_COLUMNS as usize ) ;
673
670
if let Err ( e) = layout {
674
- error ! ( "dtvcc_handle_DFx_DefineWindow: Incorrect Layout, {}" , e ) ;
671
+ error ! ( "dtvcc_handle_DFx_DefineWindow: Incorrect Layout, {e}" ) ;
675
672
} else {
676
673
unsafe { dealloc ( window. rows [ i] as * mut u8 , layout. unwrap ( ) ) } ;
677
674
}
@@ -699,13 +696,9 @@ impl dtvcc_service_decoder {
699
696
let italic = ( block[ 1 ] >> 7 ) & 0x1 ;
700
697
debug ! ( "dtvcc_handle_SPA_SetPenAttributes: attributes: " ) ;
701
698
debug ! (
702
- "Pen size: [{}] Offset: [{}] Text tag: [{}] Font tag: [{}]" ,
703
- pen_size, offset, text_tag, font_tag
704
- ) ;
705
- debug ! (
706
- "Edge type: [{}] Underline: [{}] Italic: [{}]" ,
707
- edge_type, underline, italic
699
+ "Pen size: [{pen_size}] Offset: [{offset}] Text tag: [{text_tag}] Font tag: [{font_tag}]"
708
700
) ;
701
+ debug ! ( "Edge type: [{edge_type}] Underline: [{underline}] Italic: [{italic}]" ) ;
709
702
710
703
let window = & mut self . windows [ self . current_window as usize ] ;
711
704
if window. pen_row == -1 {
@@ -738,15 +731,9 @@ impl dtvcc_service_decoder {
738
731
let bg_opacity = ( block[ 1 ] >> 6 ) & 0x03 ;
739
732
let edge_color = ( block[ 2 ] ) & 0x3f ;
740
733
debug ! ( "dtvcc_handle_SPC_SetPenColor: attributes: " ) ;
741
- debug ! (
742
- "Foreground color: [{}] Foreground opacity: [{}]" ,
743
- fg_color, fg_opacity
744
- ) ;
745
- debug ! (
746
- "Background color: [{}] Background opacity: [{}]" ,
747
- bg_color, bg_opacity
748
- ) ;
749
- debug ! ( "Edge color: [{}]" , edge_color) ;
734
+ debug ! ( "Foreground color: [{fg_color}] Foreground opacity: [{fg_opacity}]" ) ;
735
+ debug ! ( "Background color: [{bg_color}] Background opacity: [{bg_opacity}]" ) ;
736
+ debug ! ( "Edge color: [{edge_color}]" ) ;
750
737
751
738
let window = & mut self . windows [ self . current_window as usize ] ;
752
739
if window. pen_row == -1 {
@@ -774,7 +761,7 @@ impl dtvcc_service_decoder {
774
761
debug ! ( "dtvcc_handle_SPL_SetPenLocation: attributes: " ) ;
775
762
let row = block[ 0 ] & 0x0f ;
776
763
let col = block[ 1 ] & 0x3f ;
777
- debug ! ( "Row: [{}] Column: [{}]" , row , col ) ;
764
+ debug ! ( "Row: [{row }] Column: [{col }]" ) ;
778
765
779
766
let window = & mut self . windows [ self . current_window as usize ] ;
780
767
window. pen_row = row as i32 ;
@@ -804,16 +791,13 @@ impl dtvcc_service_decoder {
804
791
let effect_speed = ( block[ 3 ] >> 4 ) & 0x0f ;
805
792
debug ! ( "dtvcc_handle_SWA_SetWindowAttributes: attributes: " ) ;
806
793
debug ! (
807
- "Fill color: [{}] Fill opacity: [{}] Border color: [{}] Border type: [{}]" ,
808
- fill_color, fill_opacity, border_color, border_type
794
+ "Fill color: [{fill_color}] Fill opacity: [{fill_opacity}] Border color: [{border_color}] Border type: [{border_type}]"
809
795
) ;
810
796
debug ! (
811
- "Justify: [{}] Scroll dir: [{}] Print dir: [{}] Word wrap: [{}]" ,
812
- justify, scroll_dir, print_dir, word_wrap
797
+ "Justify: [{justify}] Scroll dir: [{scroll_dir}] Print dir: [{print_dir}] Word wrap: [{word_wrap}]"
813
798
) ;
814
799
debug ! (
815
- "Border type: [{}] Display eff: [{}] Effect dir: [{}] Effect speed: [{}]" ,
816
- border_type, display_eff, effect_dir, effect_speed
800
+ "Border type: [{border_type}] Display eff: [{display_eff}] Effect dir: [{effect_dir}] Effect speed: [{effect_speed}]"
817
801
) ;
818
802
819
803
let window_attribts = & mut self . windows [ self . current_window as usize ] . attribs ;
@@ -834,23 +818,17 @@ impl dtvcc_service_decoder {
834
818
///
835
819
/// Change current window to the window id provided
836
820
pub fn handle_set_current_window ( & mut self , window_id : u8 ) {
837
- debug ! ( "dtvcc_handle_CWx_SetCurrentWindow: [{}]" , window_id ) ;
821
+ debug ! ( "dtvcc_handle_CWx_SetCurrentWindow: [{window_id }]" ) ;
838
822
if is_true ( self . windows [ window_id as usize ] . is_defined ) {
839
823
self . current_window = window_id as i32 ;
840
824
} else {
841
- debug ! (
842
- "dtvcc_handle_CWx_SetCurrentWindow: window [{}] is not defined" ,
843
- window_id
844
- ) ;
825
+ debug ! ( "dtvcc_handle_CWx_SetCurrentWindow: window [{window_id}] is not defined" ) ;
845
826
}
846
827
}
847
828
848
829
/// DLY Delay
849
830
pub fn handle_delay ( & mut self , tenths_of_sec : u8 ) {
850
- debug ! (
851
- "dtvcc_handle_DLY_Delay: dely for {} tenths of second" ,
852
- tenths_of_sec
853
- ) ;
831
+ debug ! ( "dtvcc_handle_DLY_Delay: dely for {tenths_of_sec} tenths of second" ) ;
854
832
}
855
833
856
834
/// DLC Delay Cancel
@@ -910,7 +888,7 @@ impl dtvcc_service_decoder {
910
888
let anchor = match dtvcc_pen_anchor_point:: new ( window. anchor_point ) {
911
889
Ok ( val) => val,
912
890
Err ( e) => {
913
- warn ! ( "{}" , e ) ;
891
+ warn ! ( "{e}" ) ;
914
892
return ;
915
893
}
916
894
} ;
@@ -955,7 +933,7 @@ impl dtvcc_service_decoder {
955
933
"For window {}: Anchor point -> {}, size {}:{}, real position {}:{}" ,
956
934
window. number, window. anchor_point, window. row_count, window. col_count, top, left
957
935
) ;
958
- debug ! ( "we have top [{}] and left [{}]" , top , left ) ;
936
+ debug ! ( "we have top [{top }] and left [{left }]" ) ;
959
937
if top < 0 {
960
938
top = 0
961
939
}
@@ -972,7 +950,7 @@ impl dtvcc_service_decoder {
972
950
} else {
973
951
window. col_count
974
952
} ;
975
- debug ! ( "{}*{} will be copied to the TV." , copy_rows , copy_cols ) ;
953
+ debug ! ( "{copy_rows }*{copy_cols } will be copied to the TV." ) ;
976
954
977
955
unsafe {
978
956
let tv = & mut * self . tv ;
@@ -997,7 +975,7 @@ impl dtvcc_service_decoder {
997
975
let ( a_x1, a_x2, a_y1, a_y2) = match window. get_dimensions ( ) {
998
976
Ok ( val) => val,
999
977
Err ( e) => {
1000
- warn ! ( "{}" , e ) ;
978
+ warn ! ( "{e}" ) ;
1001
979
return false ;
1002
980
}
1003
981
} ;
@@ -1006,7 +984,7 @@ impl dtvcc_service_decoder {
1006
984
let ( b_x1, b_x2, b_y1, b_y2) = match win_compare. get_dimensions ( ) {
1007
985
Ok ( val) => val,
1008
986
Err ( e) => {
1009
- warn ! ( "{}" , e ) ;
987
+ warn ! ( "{e}" ) ;
1010
988
return false ;
1011
989
}
1012
990
} ;
@@ -1156,7 +1134,7 @@ impl dtvcc_service_decoder {
1156
1134
let pd = match dtvcc_window_pd:: new ( window. attribs . print_direction ) {
1157
1135
Ok ( val) => val,
1158
1136
Err ( e) => {
1159
- warn ! ( "{}" , e ) ;
1137
+ warn ! ( "{e}" ) ;
1160
1138
return ;
1161
1139
}
1162
1140
} ;
0 commit comments