diff options
Diffstat (limited to 'grasp-audit/src/result.rs')
| -rw-r--r-- | grasp-audit/src/result.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/grasp-audit/src/result.rs b/grasp-audit/src/result.rs index 2bec5c8..bc0008a 100644 --- a/grasp-audit/src/result.rs +++ b/grasp-audit/src/result.rs | |||
| @@ -17,7 +17,12 @@ fn extract_spec_category(spec_ref: &str) -> String { | |||
| 17 | if parts.len() >= 2 { | 17 | if parts.len() >= 2 { |
| 18 | // Check if the last part looks like a test number (starts with digit) | 18 | // Check if the last part looks like a test number (starts with digit) |
| 19 | if let Some(last) = parts.last() { | 19 | if let Some(last) = parts.last() { |
| 20 | if last.chars().next().map(|c| c.is_ascii_digit()).unwrap_or(false) { | 20 | if last |
| 21 | .chars() | ||
| 22 | .next() | ||
| 23 | .map(|c| c.is_ascii_digit()) | ||
| 24 | .unwrap_or(false) | ||
| 25 | { | ||
| 21 | // Remove the trailing number part | 26 | // Remove the trailing number part |
| 22 | return parts[..parts.len() - 1].join(":"); | 27 | return parts[..parts.len() - 1].join(":"); |
| 23 | } | 28 | } |
| @@ -146,10 +151,7 @@ impl AuditResult { | |||
| 146 | for result in &self.results { | 151 | for result in &self.results { |
| 147 | // Extract category from spec_ref (e.g., "GRASP-01:event-acceptance:1.1" -> "GRASP-01:event-acceptance") | 152 | // Extract category from spec_ref (e.g., "GRASP-01:event-acceptance:1.1" -> "GRASP-01:event-acceptance") |
| 148 | let category = extract_spec_category(&result.spec_ref); | 153 | let category = extract_spec_category(&result.spec_ref); |
| 149 | grouped | 154 | grouped.entry(category).or_default().push(result); |
| 150 | .entry(category) | ||
| 151 | .or_default() | ||
| 152 | .push(result); | ||
| 153 | } | 155 | } |
| 154 | 156 | ||
| 155 | // Print grouped results | 157 | // Print grouped results |