File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -39,9 +39,15 @@ mod control_requests {
3939pub fn to_roff ( styled_text : & str ) -> Roff {
4040 let mut doc = Roff :: new ( ) ;
4141 for styled in styled_str:: styled_stream ( styled_text) {
42- set_color (
43- ( & styled. style . get_fg_color ( ) , & styled. style . get_bg_color ( ) ) ,
42+ add_color_to_roff (
4443 & mut doc,
44+ control_requests:: FOREGROUND ,
45+ & styled. style . get_fg_color ( ) ,
46+ ) ;
47+ add_color_to_roff (
48+ & mut doc,
49+ control_requests:: BACKGROUND ,
50+ & styled. style . get_bg_color ( ) ,
4551 ) ;
4652 set_effects_and_text ( & styled, & mut doc) ;
4753 }
@@ -93,13 +99,6 @@ fn is_bright(fg_color: &Color) -> bool {
9399 }
94100}
95101
96- type ColorSet < ' a > = ( & ' a Option < Color > , & ' a Option < Color > ) ;
97-
98- fn set_color ( colors : ColorSet < ' _ > , doc : & mut Roff ) {
99- add_color_to_roff ( doc, control_requests:: FOREGROUND , colors. 0 ) ;
100- add_color_to_roff ( doc, control_requests:: BACKGROUND , colors. 1 ) ;
101- }
102-
103102fn add_color_to_roff ( doc : & mut Roff , control_request : & str , color : & Option < Color > ) {
104103 match color {
105104 Some ( Color :: Rgb ( c) ) => {
You can’t perform that action at this time.
0 commit comments