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>)
| 479 | /// reconstructed (always non-empty by the time additional views are |
| 480 | /// considered). |
| 481 | pub fn classify_inventory(inventory: &[String], applied: &HashSet<String>) -> InventoryOutcome { |
| 482 | if inventory.is_empty() { |
| 483 | return InventoryOutcome::Unsupported; |
| 484 | } |
| 485 | let others: Vec<String> = inventory |
| 486 | .iter() |
| 487 | .filter(|name| !applied.contains(*name)) |
| 488 | .cloned() |
| 489 | .collect(); |
| 490 | if others.is_empty() { |
| 491 | InventoryOutcome::NothingNew |
| 492 | } else { |
| 493 | InventoryOutcome::Views(others) |
| 494 | } |
| 495 | } |
| 496 | |
| 497 | // Error Conversion |
| 498 |
no test coverage detected