MCPcopy Index your code
hub / github.com/encounter/objdiff / join_single_dir_entries

Function join_single_dir_entries

objdiff-gui/src/config.rs:19–32  ·  view source on GitHub ↗
(nodes: &mut Vec<ProjectObjectNode>)

Source from the content-addressed store, hash-verified

17}
18
19fn join_single_dir_entries(nodes: &mut Vec<ProjectObjectNode>) {
20 for node in nodes {
21 if let ProjectObjectNode::Dir(my_name, my_nodes) = node {
22 join_single_dir_entries(my_nodes);
23 // If this directory consists of a single sub-directory...
24 if let [ProjectObjectNode::Dir(sub_name, sub_nodes)] = &mut my_nodes[..] {
25 // ... join the two names with a path separator and eliminate the layer
26 *my_name += "/";
27 *my_name += sub_name;
28 *my_nodes = std::mem::take(sub_nodes);
29 }
30 }
31 }
32}
33
34fn find_dir<'a>(
35 name: &str,

Callers 1

build_nodesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected