Explorar o código

refactor(clippy): clippy::needless_late_init

I think I did this >_<, all the more reason to get clippy working asap!

Signed-off-by: Christina Sørensen <christina@cafkafk.com>
Christina Sørensen %!s(int64=2) %!d(string=hai) anos
pai
achega
c485b560dd
Modificáronse 1 ficheiros con 4 adicións e 6 borrados
  1. 4 6
      src/output/grid.rs

+ 4 - 6
src/output/grid.rs

@@ -44,12 +44,10 @@ impl<'a> Render<'a> {
         for file in &self.files {
             let filename = self.file_style.for_file(file, self.theme);
             let contents = filename.paint();
-            let width;
-
-            match (filename.options.embed_hyperlinks, filename.options.show_icons) {
-                (EmbedHyperlinks::On, ShowIcons::On(spacing)) => width = filename.bare_width() + 1 + (spacing as usize),
-                (EmbedHyperlinks::On, ShowIcons::Off) => width = filename.bare_width(),
-                (EmbedHyperlinks::Off, _) => width = *contents.width(),
+            let width = match (filename.options.embed_hyperlinks, filename.options.show_icons) {
+                (EmbedHyperlinks::On, ShowIcons::On(spacing)) => filename.bare_width() + 1 + (spacing as usize),
+                (EmbedHyperlinks::On, ShowIcons::Off) => filename.bare_width(),
+                (EmbedHyperlinks::Off, _) => *contents.width(),
             };
 
             grid.add(tg::Cell {