Skip to content

Commit

Permalink
Use the functional update syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamed-abdelnour authored and sharkdp committed May 27, 2021
1 parent a27814d commit 425a0f9
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/printer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,10 @@ impl<'a> Printer for InteractivePrinter<'a> {

if text.len() != text_trimmed.len() {
if let Some(background_color) = background_color {
let mut ansi_style = Style::default();
ansi_style.background = to_ansi_color(background_color, true_color);
let ansi_style = Style {
background: to_ansi_color(background_color, true_color),
..Default::default()
};
let width = if cursor_total <= cursor_max {
cursor_max - cursor_total + 1
} else {
Expand Down Expand Up @@ -588,8 +590,10 @@ impl<'a> Printer for InteractivePrinter<'a> {
}

if let Some(background_color) = background_color {
let mut ansi_style = Style::default();
ansi_style.background = to_ansi_color(background_color, self.config.true_color);
let ansi_style = Style {
background: to_ansi_color(background_color, self.config.true_color),
..Default::default()
};

write!(
handle,
Expand Down

0 comments on commit 425a0f9

Please sign in to comment.