Przeglądaj źródła

fix: rename variable and remove unneeded fn parameter in details

PThorpe92 2 lat temu
rodzic
commit
8def9e3d16
1 zmienionych plików z 2 dodań i 3 usunięć
  1. 2 3
      src/output/details.rs

+ 2 - 3
src/output/details.rs

@@ -227,9 +227,8 @@ impl<'a> Render<'a> {
         w: &mut impl Write,
         w: &mut impl Write,
         row: &TextCell,
         row: &TextCell,
         header: &Option<TextCell>,
         header: &Option<TextCell>,
-        file_num: usize,
     ) -> io::Result<()> {
     ) -> io::Result<()> {
-        let mut j: usize = 0;
+        let mut header_idx: usize = 0;
         for (i, cell) in row.contents.iter().enumerate() {
         for (i, cell) in row.contents.iter().enumerate() {
             if cell.is_empty() || cell.trim().is_empty() {
             if cell.is_empty() || cell.trim().is_empty() {
                 continue;
                 continue;
@@ -257,7 +256,7 @@ impl<'a> Render<'a> {
         let (row, depth) = iter.next().unwrap();
         let (row, depth) = iter.next().unwrap();
         self.print_row_contents(w, &row, header)?;
         self.print_row_contents(w, &row, header)?;
         writeln!(w, ", \"depth\": {}", depth.depth.0)?;
         writeln!(w, ", \"depth\": {}", depth.depth.0)?;
-        writeln!(w, ", \"current\": {}", current_depth)?;
+        writeln!(w, ", \"current\": {current_depth}")?;
         if depth.depth.0 as i32 > current_depth {
         if depth.depth.0 as i32 > current_depth {
             writeln!(w, ", \"children\": [{{")?;
             writeln!(w, ", \"children\": [{{")?;
             writeln!(w, "}}]")?;
             writeln!(w, "}}]")?;