diff options
author | Dan Davison <dandavison7@gmail.com> | 2020-06-23 22:26:41 -0400 |
---|---|---|
committer | Dan Davison <dandavison7@gmail.com> | 2020-06-25 12:35:07 -0400 |
commit | 06b50bd2f2155ee44d1f6049d4f39b3f06562b2b (patch) | |
tree | af0b6a92fd25d7f2e8ff8b3bcb3629a8a74ee576 /src/paint.rs | |
parent | 8ca7d67058b8beeb4472e904fb19feb0934b5327 (diff) |
Formatting
Diffstat (limited to 'src/paint.rs')
-rw-r--r-- | src/paint.rs | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/paint.rs b/src/paint.rs index 328f35d2..dab68901 100644 --- a/src/paint.rs +++ b/src/paint.rs @@ -618,7 +618,7 @@ fn get_zero_or_default_style( } } -fn format_number_components <'a>( +fn format_number_components<'a>( minus: Option<usize>, plus: Option<usize>, format_string: &'a str, @@ -664,11 +664,10 @@ fn format_number_components <'a>( formatted_number_strings } -fn get_formatted_line_number_components <'a>( +fn get_formatted_line_number_components<'a>( line_numbers: &'a Option<(Option<usize>, Option<usize>)>, config: &'a config::Config, ) -> Vec<ansi_term::ANSIGenericString<'a, str>> { - let (minus, plus) = line_numbers.unwrap(); let number_minus_style = get_zero_or_default_style( @@ -687,8 +686,22 @@ fn get_formatted_line_number_components <'a>( let mut formatted_numbers = Vec::new(); - formatted_numbers.extend(format_number_components(minus, plus, &config.number_left_format, &config.number_left_format_style, &number_minus_style, &number_plus_style)); - formatted_numbers.extend(format_number_components(minus, plus,&config.number_right_format, &config.number_right_format_style, &number_minus_style, &number_plus_style)); + formatted_numbers.extend(format_number_components( + minus, + plus, + &config.number_left_format, + &config.number_left_format_style, + &number_minus_style, + &number_plus_style, + )); + formatted_numbers.extend(format_number_components( + minus, + plus, + &config.number_right_format, + &config.number_right_format_style, + &number_minus_style, + &number_plus_style, + )); formatted_numbers } |