From 278c153d31788575079a8c22da594deaf8e7a2f7 Mon Sep 17 00:00:00 2001 From: Florian Dehau Date: Fri, 13 Mar 2020 01:12:14 +0100 Subject: [PATCH] style: remove clippy warnings --- src/widgets/canvas/line.rs | 8 +++----- src/widgets/list.rs | 2 -- src/widgets/table.rs | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/widgets/canvas/line.rs b/src/widgets/canvas/line.rs index 1a1e062..5e2a61b 100644 --- a/src/widgets/canvas/line.rs +++ b/src/widgets/canvas/line.rs @@ -48,12 +48,10 @@ impl Shape for Line { } else { draw_line_low(painter, x1, y1, x2, y2, self.color); } + } else if y1 > y2 { + draw_line_high(painter, x2, y2, x1, y1, self.color); } else { - if y1 > y2 { - draw_line_high(painter, x2, y2, x1, y1, self.color); - } else { - draw_line_high(painter, x1, y1, x2, y2, self.color); - } + draw_line_high(painter, x1, y1, x2, y2, self.color); } } } diff --git a/src/widgets/list.rs b/src/widgets/list.rs index 2fb81ff..f83e431 100644 --- a/src/widgets/list.rs +++ b/src/widgets/list.rs @@ -41,14 +41,12 @@ impl ListState { /// ``` /// # use tui::widgets::{Block, Borders, List, Text}; /// # use tui::style::{Style, Color, Modifier}; -/// # fn main() { /// let items = ["Item 1", "Item 2", "Item 3"].iter().map(|i| Text::raw(*i)); /// List::new(items) /// .block(Block::default().title("List").borders(Borders::ALL)) /// .style(Style::default().fg(Color::White)) /// .highlight_style(Style::default().modifier(Modifier::ITALIC)) /// .highlight_symbol(">>"); -/// # } /// ``` pub struct List<'b, L> where diff --git a/src/widgets/table.rs b/src/widgets/table.rs index 8a8ed67..55890b2 100644 --- a/src/widgets/table.rs +++ b/src/widgets/table.rs @@ -131,7 +131,7 @@ where Table { block: None, style: Style::default(), - header: header.into_iter(), + header, header_style: Style::default(), widths: &[], column_spacing: 1,