From 7e36e5c1e45932562450c8c708b6c9c5b04ff5c7 Mon Sep 17 00:00:00 2001 From: Benjamin Sago Date: Sun, 26 Apr 2020 14:13:15 +0100 Subject: [PATCH] Three Clippy fixes --- src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index d9c0b77..db52fc0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -342,7 +342,7 @@ impl Grid { let mut cells = self.cells.clone(); cells.sort_unstable_by(|a, b| b.cmp(a)); // Sort in reverse order - for cell in cells.iter() { + for cell in &cells { if cell.width + col_total_width_so_far <= maximum_width { theoretical_min_num_cols += 1; col_total_width_so_far += cell.width; @@ -359,7 +359,7 @@ impl Grid { // If we make it to this point, we have exhausted all cells before // reaching the maximum width; the theoretical max number of lines // needed to display all cells is 1. - return 1; + 1 } fn width_dimensions(&self, maximum_width: Width) -> Option { @@ -499,7 +499,7 @@ impl<'grid> fmt::Display for Display<'grid> { } } - write!(f, "\n")?; + writeln!(f)?; } Ok(())