Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Improve branch structure #974

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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