diff options
author | Dan Davison <dandavison7@gmail.com> | 2019-07-27 16:45:04 -0400 |
---|---|---|
committer | Dan Davison <dandavison7@gmail.com> | 2019-07-27 16:45:34 -0400 |
commit | 6ee4fb4db72eecb7704c74cb76f77b5ec7e29000 (patch) | |
tree | 362aeb9dc350639e0664b56b7c6b62c547266181 /src/paint.rs | |
parent | 5c6d42d494ebb1573a9c5eb67d032d348fb29b72 (diff) |
Use same lifetime for minus and plus lines
Diffstat (limited to 'src/paint.rs')
-rw-r--r-- | src/paint.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/paint.rs b/src/paint.rs index d15e2dcb..b5ec5d01 100644 --- a/src/paint.rs +++ b/src/paint.rs @@ -61,7 +61,6 @@ impl<'a> Painter<'a> { minus_line_syntax_style_sections, minus_line_diff_style_sections, ); - self.minus_lines.clear(); } if self.plus_lines.len() > 0 { Painter::paint_lines( @@ -69,8 +68,9 @@ impl<'a> Painter<'a> { plus_line_syntax_style_sections, plus_line_diff_style_sections, ); - self.plus_lines.clear(); } + self.minus_lines.clear(); + self.plus_lines.clear(); } /// Superimpose background styles and foreground syntax @@ -138,13 +138,13 @@ impl<'a> Painter<'a> { } /// Set background styles to represent diff for minus and plus lines in buffer. - fn get_diff_style_sections<'m, 'p>( - minus_lines: &'m Vec<String>, - plus_lines: &'p Vec<String>, + fn get_diff_style_sections<'b>( + minus_lines: &'b Vec<String>, + plus_lines: &'b Vec<String>, config: &config::Config, ) -> ( - Vec<Vec<(StyleModifier, &'m str)>>, - Vec<Vec<(StyleModifier, &'p str)>>, + Vec<Vec<(StyleModifier, &'b str)>>, + Vec<Vec<(StyleModifier, &'b str)>>, ) { if minus_lines.len() == plus_lines.len() { edits::infer_edit_sections( |