diff options
author | Christian Duerr <chrisduerr@users.noreply.github.com> | 2018-07-01 16:31:46 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-01 16:31:46 +0000 |
commit | 12afbd007db8a8995617b3e7ebda3840860bbadc (patch) | |
tree | a0de7c3db93b18b5edbbe44ab2f6b179ae6acc28 /src/term/mod.rs | |
parent | d5690f6cc75908d81d0eccf57e62d486c13d34f5 (diff) | |
download | alacritty-12afbd007db8a8995617b3e7ebda3840860bbadc.tar.gz alacritty-12afbd007db8a8995617b3e7ebda3840860bbadc.zip |
Fix clippy issues
Diffstat (limited to 'src/term/mod.rs')
-rw-r--r-- | src/term/mod.rs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/term/mod.rs b/src/term/mod.rs index 27cc9312..d1f48c91 100644 --- a/src/term/mod.rs +++ b/src/term/mod.rs @@ -269,9 +269,9 @@ impl<'a> RenderableCellsIter<'a> { self.mode.contains(mode::TermMode::SHOW_CURSOR) && self.grid.contains(self.cursor) } - fn compute_fg_rgb(&self, fg: &Color, cell: &Cell) -> Rgb { + fn compute_fg_rgb(&self, fg: Color, cell: &Cell) -> Rgb { use self::cell::Flags; - match *fg { + match fg { Color::Spec(rgb) => rgb, Color::Named(ansi) => { match (self.config.draw_bold_text_with_bright_colors(), cell.flags & Flags::DIM_BOLD) { @@ -302,15 +302,15 @@ impl<'a> RenderableCellsIter<'a> { } #[inline] - fn compute_bg_alpha(&self, bg: &Color) -> f32 { - match *bg { + fn compute_bg_alpha(&self, bg: Color) -> f32 { + match bg { Color::Named(NamedColor::Background) => 0.0, _ => 1.0 } } - fn compute_bg_rgb(&self, bg: &Color) -> Rgb { - match *bg { + fn compute_bg_rgb(&self, bg: Color) -> Rgb { + match bg { Color::Spec(rgb) => rgb, Color::Named(ansi) => self.colors[ansi], Color::Indexed(idx) => self.colors[idx], @@ -387,13 +387,13 @@ impl<'a> Iterator for RenderableCellsIter<'a> { fg_rgb = self.colors[NamedColor::Background]; bg_alpha = 1.0 } else { - bg_rgb = self.compute_fg_rgb(&cell.fg, &cell); - fg_rgb = self.compute_bg_rgb(&cell.bg); + bg_rgb = self.compute_fg_rgb(cell.fg, &cell); + fg_rgb = self.compute_bg_rgb(cell.bg); } } else { - fg_rgb = self.compute_fg_rgb(&cell.fg, &cell); - bg_rgb = self.compute_bg_rgb(&cell.bg); - bg_alpha = self.compute_bg_alpha(&cell.bg); + fg_rgb = self.compute_fg_rgb(cell.fg, &cell); + bg_rgb = self.compute_bg_rgb(cell.bg); + bg_alpha = self.compute_bg_alpha(cell.bg); } return Some(RenderableCell { |