(
label: &str,
projects: Vec<CodeProjectRecord>,
limit: usize,
json_output: bool,
)
| 74 | } |
| 75 | |
| 76 | fn print_projects( |
| 77 | label: &str, |
| 78 | projects: Vec<CodeProjectRecord>, |
| 79 | limit: usize, |
| 80 | json_output: bool, |
| 81 | ) -> Result<()> { |
| 82 | if json_output { |
| 83 | println!( |
| 84 | "{}", |
| 85 | serde_json::to_string_pretty(&json!({ |
| 86 | "limit": limit, |
| 87 | "projects": projects, |
| 88 | }))? |
| 89 | ); |
| 90 | } else { |
| 91 | print_project_table(label, &projects); |
| 92 | } |
| 93 | Ok(()) |
| 94 | } |
| 95 | |
| 96 | fn print_project_table(label: &str, projects: &[CodeProjectRecord]) { |
| 97 | if projects.is_empty() { |
no test coverage detected