@@ -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 ) {
@@ -526,8 +526,7 @@ impl dtvcc_service_decoder {
526
526
timing : & mut ccx_common_timing_ctx ,
527
527
) {
528
528
debug ! (
529
- "dtvcc_handle_DFx_DefineWindow: W[{}], attributes:" ,
530
- window_id
529
+ "dtvcc_handle_DFx_DefineWindow: W[{window_id}], attributes:"
531
530
) ;
532
531
let window = & mut self . windows [ window_id as usize ] ;
533
532
let block = & block[ ..=5 ] ;
@@ -562,12 +561,12 @@ impl dtvcc_service_decoder {
562
561
let mut do_clear_window = false ;
563
562
564
563
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 ) ;
564
+ debug ! ( "Priority: [{priority }]" ) ;
565
+ debug ! ( "Row count: [{row_count }]" ) ;
566
+ debug ! ( "Column count: [{col_count }]" ) ;
567
+ debug ! ( "Anchor point: [{anchor_point }]" ) ;
568
+ debug ! ( "Anchor vertical: [{anchor_vertical }]" ) ;
569
+ debug ! ( "Anchor horizontal: [{anchor_horizontal }]" ) ;
571
570
debug ! (
572
571
"Relative pos: [{}]" ,
573
572
if is_true( relative_pos) { "Yes" } else { "No" }
@@ -580,8 +579,8 @@ impl dtvcc_service_decoder {
580
579
"Column lock: [{}]" ,
581
580
if is_true( col_lock) { "Yes" } else { "No" }
582
581
) ;
583
- debug ! ( "Pen style: [{}]" , pen_style ) ;
584
- debug ! ( "Win style: [{}]" , win_style ) ;
582
+ debug ! ( "Pen style: [{pen_style }]" ) ;
583
+ debug ! ( "Win style: [{win_style }]" ) ;
585
584
586
585
// Korean samples have "anchor_vertical" and "anchor_horizontal" mixed up,
587
586
// this seems to be an encoder issue, but we can workaround it
@@ -640,7 +639,7 @@ impl dtvcc_service_decoder {
640
639
for i in 0 ..CCX_DTVCC_MAX_ROWS as usize {
641
640
let layout = Layout :: array :: < dtvcc_symbol > ( CCX_DTVCC_MAX_COLUMNS as usize ) ;
642
641
if let Err ( e) = layout {
643
- error ! ( "dtvcc_handle_DFx_DefineWindow: Incorrect Layout, {}" , e ) ;
642
+ error ! ( "dtvcc_handle_DFx_DefineWindow: Incorrect Layout, {e}" ) ;
644
643
} else {
645
644
let ptr = unsafe { alloc ( layout. unwrap ( ) ) } ;
646
645
if ptr. is_null ( ) {
@@ -671,7 +670,7 @@ impl dtvcc_service_decoder {
671
670
for i in 0 ..CCX_DTVCC_MAX_ROWS as usize {
672
671
let layout = Layout :: array :: < dtvcc_symbol > ( CCX_DTVCC_MAX_COLUMNS as usize ) ;
673
672
if let Err ( e) = layout {
674
- error ! ( "dtvcc_handle_DFx_DefineWindow: Incorrect Layout, {}" , e ) ;
673
+ error ! ( "dtvcc_handle_DFx_DefineWindow: Incorrect Layout, {e}" ) ;
675
674
} else {
676
675
unsafe { dealloc ( window. rows [ i] as * mut u8 , layout. unwrap ( ) ) } ;
677
676
}
@@ -699,12 +698,10 @@ impl dtvcc_service_decoder {
699
698
let italic = ( block[ 1 ] >> 7 ) & 0x1 ;
700
699
debug ! ( "dtvcc_handle_SPA_SetPenAttributes: attributes: " ) ;
701
700
debug ! (
702
- "Pen size: [{}] Offset: [{}] Text tag: [{}] Font tag: [{}]" ,
703
- pen_size, offset, text_tag, font_tag
701
+ "Pen size: [{pen_size}] Offset: [{offset}] Text tag: [{text_tag}] Font tag: [{font_tag}]"
704
702
) ;
705
703
debug ! (
706
- "Edge type: [{}] Underline: [{}] Italic: [{}]" ,
707
- edge_type, underline, italic
704
+ "Edge type: [{edge_type}] Underline: [{underline}] Italic: [{italic}]"
708
705
) ;
709
706
710
707
let window = & mut self . windows [ self . current_window as usize ] ;
@@ -739,14 +736,12 @@ impl dtvcc_service_decoder {
739
736
let edge_color = ( block[ 2 ] ) & 0x3f ;
740
737
debug ! ( "dtvcc_handle_SPC_SetPenColor: attributes: " ) ;
741
738
debug ! (
742
- "Foreground color: [{}] Foreground opacity: [{}]" ,
743
- fg_color, fg_opacity
739
+ "Foreground color: [{fg_color}] Foreground opacity: [{fg_opacity}]"
744
740
) ;
745
741
debug ! (
746
- "Background color: [{}] Background opacity: [{}]" ,
747
- bg_color, bg_opacity
742
+ "Background color: [{bg_color}] Background opacity: [{bg_opacity}]"
748
743
) ;
749
- debug ! ( "Edge color: [{}]" , edge_color ) ;
744
+ debug ! ( "Edge color: [{edge_color }]" ) ;
750
745
751
746
let window = & mut self . windows [ self . current_window as usize ] ;
752
747
if window. pen_row == -1 {
@@ -774,7 +769,7 @@ impl dtvcc_service_decoder {
774
769
debug ! ( "dtvcc_handle_SPL_SetPenLocation: attributes: " ) ;
775
770
let row = block[ 0 ] & 0x0f ;
776
771
let col = block[ 1 ] & 0x3f ;
777
- debug ! ( "Row: [{}] Column: [{}]" , row , col ) ;
772
+ debug ! ( "Row: [{row }] Column: [{col }]" ) ;
778
773
779
774
let window = & mut self . windows [ self . current_window as usize ] ;
780
775
window. pen_row = row as i32 ;
@@ -804,16 +799,13 @@ impl dtvcc_service_decoder {
804
799
let effect_speed = ( block[ 3 ] >> 4 ) & 0x0f ;
805
800
debug ! ( "dtvcc_handle_SWA_SetWindowAttributes: attributes: " ) ;
806
801
debug ! (
807
- "Fill color: [{}] Fill opacity: [{}] Border color: [{}] Border type: [{}]" ,
808
- fill_color, fill_opacity, border_color, border_type
802
+ "Fill color: [{fill_color}] Fill opacity: [{fill_opacity}] Border color: [{border_color}] Border type: [{border_type}]"
809
803
) ;
810
804
debug ! (
811
- "Justify: [{}] Scroll dir: [{}] Print dir: [{}] Word wrap: [{}]" ,
812
- justify, scroll_dir, print_dir, word_wrap
805
+ "Justify: [{justify}] Scroll dir: [{scroll_dir}] Print dir: [{print_dir}] Word wrap: [{word_wrap}]"
813
806
) ;
814
807
debug ! (
815
- "Border type: [{}] Display eff: [{}] Effect dir: [{}] Effect speed: [{}]" ,
816
- border_type, display_eff, effect_dir, effect_speed
808
+ "Border type: [{border_type}] Display eff: [{display_eff}] Effect dir: [{effect_dir}] Effect speed: [{effect_speed}]"
817
809
) ;
818
810
819
811
let window_attribts = & mut self . windows [ self . current_window as usize ] . attribs ;
@@ -834,22 +826,20 @@ impl dtvcc_service_decoder {
834
826
///
835
827
/// Change current window to the window id provided
836
828
pub fn handle_set_current_window ( & mut self , window_id : u8 ) {
837
- debug ! ( "dtvcc_handle_CWx_SetCurrentWindow: [{}]" , window_id ) ;
829
+ debug ! ( "dtvcc_handle_CWx_SetCurrentWindow: [{window_id }]" ) ;
838
830
if is_true ( self . windows [ window_id as usize ] . is_defined ) {
839
831
self . current_window = window_id as i32 ;
840
832
} else {
841
833
debug ! (
842
- "dtvcc_handle_CWx_SetCurrentWindow: window [{}] is not defined" ,
843
- window_id
834
+ "dtvcc_handle_CWx_SetCurrentWindow: window [{window_id}] is not defined"
844
835
) ;
845
836
}
846
837
}
847
838
848
839
/// DLY Delay
849
840
pub fn handle_delay ( & mut self , tenths_of_sec : u8 ) {
850
841
debug ! (
851
- "dtvcc_handle_DLY_Delay: dely for {} tenths of second" ,
852
- tenths_of_sec
842
+ "dtvcc_handle_DLY_Delay: dely for {tenths_of_sec} tenths of second"
853
843
) ;
854
844
}
855
845
@@ -910,7 +900,7 @@ impl dtvcc_service_decoder {
910
900
let anchor = match dtvcc_pen_anchor_point:: new ( window. anchor_point ) {
911
901
Ok ( val) => val,
912
902
Err ( e) => {
913
- warn ! ( "{}" , e ) ;
903
+ warn ! ( "{e}" ) ;
914
904
return ;
915
905
}
916
906
} ;
@@ -955,7 +945,7 @@ impl dtvcc_service_decoder {
955
945
"For window {}: Anchor point -> {}, size {}:{}, real position {}:{}" ,
956
946
window. number, window. anchor_point, window. row_count, window. col_count, top, left
957
947
) ;
958
- debug ! ( "we have top [{}] and left [{}]" , top , left ) ;
948
+ debug ! ( "we have top [{top }] and left [{left }]" ) ;
959
949
if top < 0 {
960
950
top = 0
961
951
}
@@ -972,7 +962,7 @@ impl dtvcc_service_decoder {
972
962
} else {
973
963
window. col_count
974
964
} ;
975
- debug ! ( "{}*{} will be copied to the TV." , copy_rows , copy_cols ) ;
965
+ debug ! ( "{copy_rows }*{copy_cols } will be copied to the TV." ) ;
976
966
977
967
unsafe {
978
968
let tv = & mut * self . tv ;
@@ -997,7 +987,7 @@ impl dtvcc_service_decoder {
997
987
let ( a_x1, a_x2, a_y1, a_y2) = match window. get_dimensions ( ) {
998
988
Ok ( val) => val,
999
989
Err ( e) => {
1000
- warn ! ( "{}" , e ) ;
990
+ warn ! ( "{e}" ) ;
1001
991
return false ;
1002
992
}
1003
993
} ;
@@ -1006,7 +996,7 @@ impl dtvcc_service_decoder {
1006
996
let ( b_x1, b_x2, b_y1, b_y2) = match win_compare. get_dimensions ( ) {
1007
997
Ok ( val) => val,
1008
998
Err ( e) => {
1009
- warn ! ( "{}" , e ) ;
999
+ warn ! ( "{e}" ) ;
1010
1000
return false ;
1011
1001
}
1012
1002
} ;
@@ -1156,7 +1146,7 @@ impl dtvcc_service_decoder {
1156
1146
let pd = match dtvcc_window_pd:: new ( window. attribs . print_direction ) {
1157
1147
Ok ( val) => val,
1158
1148
Err ( e) => {
1159
- warn ! ( "{}" , e ) ;
1149
+ warn ! ( "{e}" ) ;
1160
1150
return ;
1161
1151
}
1162
1152
} ;
0 commit comments