Skip to content

Commit

Permalink
Refactor: Improve branch
Browse files Browse the repository at this point in the history
  • Loading branch information
allaboutevemirolive authored and cafkafk committed May 8, 2024
1 parent f1ef455 commit c0d63b4
Show file tree
Hide file tree
Showing 14 changed files with 25,556 additions and 25,572 deletions.
12 changes: 0 additions & 12 deletions src/output/details.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,12 +492,6 @@ impl<'a> Iterator for TableIter<'a> {
cell.push(self.tree_style.paint(tree_part.ascii_art()), 4);
}

// If any tree characters have been printed, then add an extra
// space, which makes the output look much better.
if !row.tree.is_at_root() {
cell.add_spaces(1);
}

cell.append(row.name);
cell
})
Expand All @@ -521,12 +515,6 @@ impl Iterator for Iter {
cell.push(self.tree_style.paint(tree_part.ascii_art()), 4);
}

// If any tree characters have been printed, then add an extra
// space, which makes the output look much better.
if !row.tree.is_at_root() {
cell.add_spaces(1);
}

cell.append(row.name);
cell
})
Expand Down
12 changes: 4 additions & 8 deletions src/output/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ impl TreePart {
pub fn ascii_art(self) -> &'static str {
#[rustfmt::skip]
return match self {
Self::Edge => "├──",
Self::Line => "│ ",
Self::Corner => "└──",
Self::Blank => " ",
Self::Edge => "├── ",
Self::Line => "│ ",
Self::Corner => "└── ",
Self::Blank => " ",
};
}
}
Expand Down Expand Up @@ -143,10 +143,6 @@ impl TreeParams {
pub fn new(depth: TreeDepth, last: bool) -> Self {
Self { depth, last }
}

pub fn is_at_root(&self) -> bool {
self.depth.0 == 0
}
}

impl TreeDepth {
Expand Down
Loading

0 comments on commit c0d63b4

Please sign in to comment.