Refactor: Compress arguemnts to one object

Several arguments were passed around the dirwalker file. Compress them
into a single struct.
This commit is contained in:
andy.boot
2021-07-16 13:45:06 +01:00
parent f6e36aba52
commit f219a752d6
2 changed files with 34 additions and 59 deletions
+6 -4
View File
@@ -8,6 +8,7 @@ use std::collections::HashSet;
use self::display::draw_it;
use clap::{App, AppSettings, Arg};
use dirwalker::walk_it;
use dirwalker::WalkData;
use filter::{get_biggest, get_by_depth};
use std::cmp::max;
use std::path::PathBuf;
@@ -214,14 +215,15 @@ fn main() {
.flat_map(|x| simplified_dirs.iter().map(move |d| d.join(x.clone())))
.collect();
let (nodes, errors) = walk_it(
simplified_dirs,
ignored_full_path,
let walk_data = WalkData {
ignore_directories: ignored_full_path,
allowed_filesystems,
use_apparent_size,
by_filecount,
ignore_hidden,
);
};
let (nodes, errors) = walk_it(simplified_dirs, walk_data);
let tree = {
match depth {