If no children, THEN do the syscall
This commit is contained in:
1 file changed
+1
-1
@@ -102,7 +102,7 @@ fn stream(node: &serde_json::Value, parent: &str, map: &mut HashMap<String, Vec<
|
||||
format!("{}/{}", parent, name)
|
||||
};
|
||||
|
||||
let is_dir = PathBuf::from(&path).is_dir();
|
||||
let is_dir = children.map_or(false, |c| !c.is_empty()) || PathBuf::from(&path).is_dir();
|
||||
|
||||
map.entry(parent.to_string()).or_default().push(FileInfo {
|
||||
name: name.to_string(),
|
||||
|
||||
Reference in new issue
Block a user