File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -64,14 +64,14 @@ impl WrappedBar {
64
64
65
65
fn compute_position ( & mut self ) -> f64 {
66
66
let previous_pos = self . output . position ( ) ;
67
- let pos = std:: io:: stdin ( )
67
+
68
+ std:: io:: stdin ( )
68
69
. lines ( )
69
70
. next ( )
70
71
. unwrap_or_else ( || Ok ( previous_pos. to_string ( ) ) )
71
72
. unwrap ( )
72
73
. parse :: < f64 > ( )
73
- . unwrap_or ( previous_pos as f64 ) ;
74
- pos
74
+ . unwrap_or ( previous_pos as f64 )
75
75
}
76
76
77
77
fn set_minmax ( & mut self , pos : f64 ) {
Original file line number Diff line number Diff line change @@ -6,8 +6,8 @@ pub fn run<'a>(
6
6
regex : & ' a str ,
7
7
colors : & ' a str ,
8
8
) -> Result < Vec < ColoredString > , & ' static str > {
9
- if regex. len ( ) > 0 && colors. len ( ) > 0 {
10
- return colorize ( input, regex, colors) ;
9
+ if ! regex. is_empty ( ) && ! colors. is_empty ( ) {
10
+ colorize ( input, regex, colors)
11
11
} else {
12
12
let num_commas = input. chars ( ) . filter ( |& c| c == ',' ) . count ( ) ;
13
13
let num_spaces = input. chars ( ) . filter ( |& c| c == ' ' ) . count ( ) ;
@@ -33,7 +33,7 @@ pub fn run<'a>(
33
33
regex. push_str ( " \\ s*(.*)" ) ;
34
34
}
35
35
36
- colors. push_str ( " " ) ;
36
+ colors. push ( ' ' ) ;
37
37
colors. push_str ( & possible_colors[ ( i + 1 ) % possible_colors. len ( ) ] ) ;
38
38
}
39
39
colorize ( input, & regex, & colors)
You can’t perform that action at this time.
0 commit comments