(units: &mut [ObjectConfig])
| 52 | } |
| 53 | |
| 54 | fn build_nodes(units: &mut [ObjectConfig]) -> Vec<ProjectObjectNode> { |
| 55 | let mut nodes = vec![]; |
| 56 | for (idx, unit) in units.iter_mut().enumerate() { |
| 57 | let mut out_nodes = &mut nodes; |
| 58 | let path = Utf8UnixPath::new(&unit.name); |
| 59 | if let Some(parent) = path.parent() { |
| 60 | for component in parent.components() { |
| 61 | if let Utf8UnixComponent::Normal(name) = component { |
| 62 | out_nodes = find_dir(name, out_nodes); |
| 63 | } |
| 64 | } |
| 65 | } |
| 66 | let filename = path.file_name().unwrap().to_string(); |
| 67 | out_nodes.push(ProjectObjectNode::Unit(filename, idx)); |
| 68 | } |
| 69 | // Within the top-level module directories, join paths. Leave the |
| 70 | // top-level name intact though since it's the module name. |
| 71 | for node in &mut nodes { |
| 72 | if let ProjectObjectNode::Dir(_, sub_nodes) = node { |
| 73 | join_single_dir_entries(sub_nodes); |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | nodes |
| 78 | } |
| 79 | |
| 80 | pub fn load_project_config(state: &mut AppState) -> Result<()> { |
| 81 | let Some(project_dir) = &state.config.project_dir else { |
no test coverage detected