Classify an `?views` inventory for `--all-views`. `applied` is the set of view names the primary manifest chain already reconstructed (always non-empty by the time additional views are considered).
(inventory: &[String], applied: &HashSet<String>)
| 498 | /// reconstructed (always non-empty by the time additional views are |
| 499 | /// considered). |
| 500 | pub fn classify_inventory(inventory: &[String], applied: &HashSet<String>) -> InventoryOutcome { |
| 501 | if inventory.is_empty() { |
| 502 | return InventoryOutcome::Unsupported; |
| 503 | } |
| 504 | let others: Vec<String> = inventory |
| 505 | .iter() |
| 506 | .filter(|name| !applied.contains(*name)) |
| 507 | .cloned() |
| 508 | .collect(); |
| 509 | if others.is_empty() { |
| 510 | InventoryOutcome::NothingNew |
| 511 | } else { |
| 512 | InventoryOutcome::Views(others) |
| 513 | } |
| 514 | } |
| 515 | |
| 516 | // Error Conversion |
| 517 |
no test coverage detected