mirror of
https://github.com/bootandy/dust.git
synced 2026-06-08 11:29:05 +03:00
refactor: progress bar
Pull out display code into different functions Experimented with printing the actual directory currently being parsed but this resulted into too many flickering hard to follow prints. It's cleaner to just print the target directory rather than the directory currently being examined by the dir_walker.
This commit is contained in:
+1
-1
@@ -40,6 +40,7 @@ pub fn walk_it(dirs: HashSet<PathBuf>, walk_data: WalkData) -> Vec<Node> {
|
||||
let node = walk(d, &walk_data, 0)?;
|
||||
|
||||
prog_data.state.store(Operation::PREPARING, ORDERING);
|
||||
|
||||
clean_inodes(node, &mut inodes, walk_data.use_apparent_size)
|
||||
})
|
||||
.collect();
|
||||
@@ -125,7 +126,6 @@ fn ignore_file(entry: &DirEntry, walk_data: &WalkData) -> bool {
|
||||
|
||||
fn walk(dir: PathBuf, walk_data: &WalkData, depth: usize) -> Option<Node> {
|
||||
let prog_data = &walk_data.progress_data;
|
||||
|
||||
let mut children = vec![];
|
||||
|
||||
if let Ok(entries) = fs::read_dir(&dir) {
|
||||
|
||||
Reference in New Issue
Block a user