Fix: Allow -n to be used with -d

Allow -n for number_of_lines to be used with -d 'max depth'

Remove depth specific functions, the job is now handled by the mainline

Add depth as a field onto the Node object.
This commit is contained in:
andy.boot
2022-07-01 12:25:35 +01:00
parent c4ea7815f8
commit a00d1f0719
4 changed files with 59 additions and 70 deletions
+3
View File
@@ -12,6 +12,7 @@ pub struct Node {
pub size: u64,
pub children: Vec<Node>,
pub inode_device: Option<(u64, u64)>,
pub depth: usize,
}
#[allow(clippy::too_many_arguments)]
@@ -24,6 +25,7 @@ pub fn build_node(
is_symlink: bool,
is_file: bool,
by_filecount: bool,
depth: usize,
) -> Option<Node> {
match get_metadata(&dir, use_apparent_size) {
Some(data) => {
@@ -50,6 +52,7 @@ pub fn build_node(
size,
children,
inode_device,
depth,
})
}
None => None,