mirror of
https://github.com/bootandy/dust.git
synced 2026-06-08 11:29:05 +03:00
refactor: cleanup code
This commit is contained in:
+8
-9
@@ -143,16 +143,17 @@ fn walk(
|
|||||||
|
|
||||||
// return walk(entry.path(), permissions_flag, ignore_directories, allowed_filesystems, use_apparent_size, by_filecount, ignore_hidden);
|
// return walk(entry.path(), permissions_flag, ignore_directories, allowed_filesystems, use_apparent_size, by_filecount, ignore_hidden);
|
||||||
|
|
||||||
if !ignore_file(entry, walk_data) {
|
if ignore_file(entry, walk_data) {
|
||||||
|
return None;
|
||||||
|
}
|
||||||
if let Ok(data) = entry.file_type() {
|
if let Ok(data) = entry.file_type() {
|
||||||
if data.is_symlink() && walk_data.ignore_links {
|
if data.is_symlink() && walk_data.ignore_links {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
return if data.is_dir() || (walk_data.follow_links && data.is_symlink())
|
if data.is_dir() || (walk_data.follow_links && data.is_symlink()) {
|
||||||
{
|
return walk(entry.path(), permissions_flag, walk_data, depth + 1);
|
||||||
walk(entry.path(), permissions_flag, walk_data, depth + 1)
|
}
|
||||||
} else {
|
return build_node(
|
||||||
build_node(
|
|
||||||
entry.path(),
|
entry.path(),
|
||||||
vec![],
|
vec![],
|
||||||
walk_data.filter_regex,
|
walk_data.filter_regex,
|
||||||
@@ -162,9 +163,7 @@ fn walk(
|
|||||||
data.is_file(),
|
data.is_file(),
|
||||||
walk_data.by_filecount,
|
walk_data.by_filecount,
|
||||||
depth,
|
depth,
|
||||||
)
|
);
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
permissions_flag.store(true, atomic::Ordering::Relaxed);
|
permissions_flag.store(true, atomic::Ordering::Relaxed);
|
||||||
|
|||||||
Reference in New Issue
Block a user