(file_tree: &Arc<FileTree>, depth: usize)
| 56 | } |
| 57 | |
| 58 | pub fn get_structure(file_tree: &Arc<FileTree>, depth: usize) -> StructureResponse { |
| 59 | let tree = file_tree.render_tree(depth); |
| 60 | let file_count = file_tree.len(); |
| 61 | let breakdown = file_tree |
| 62 | .language_breakdown() |
| 63 | .into_iter() |
| 64 | .map(|b| LanguageCount { |
| 65 | language: format!("{:?}", b.language).to_lowercase(), |
| 66 | count: b.count, |
| 67 | }) |
| 68 | .collect(); |
| 69 | |
| 70 | StructureResponse { |
| 71 | tree, |
| 72 | file_count, |
| 73 | language_breakdown: breakdown, |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | /// Get structure with a level-of-detail parameter. |
| 78 | /// - L0: file tree only (same as get_structure) |
no test coverage detected