Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
kenchou committed Mar 17, 2024
1 parent 4496cf4 commit 784b9bc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,12 @@ fn main() -> std::io::Result<()> {
print_tree(path_list_to_tree(&operation_list, &app_options.target_path));
}

// Remove the entries that don't require operation.
operation_list.retain(|(_, _, op)| match op {
Operation::None => false,
_ => true,
});
// Sort the operation list in depth-first order.
operation_list.sort_by(|a, b| {
let depth_a = a.0.components().count();
let depth_b = b.0.components().count();
Expand Down Expand Up @@ -555,7 +561,7 @@ fn path_list_to_tree(
} else if full_path.is_dir() {
(SYMBOL_DIR, component_str + "/")
} else {
("XXXX", component_str)
("??", component_str)
};

let mut parent = tree.get_mut(current_node_id).unwrap();
Expand Down

0 comments on commit 784b9bc

Please sign in to comment.