Recursive function which walks over `worlds`, the list of worlds that `test` expects, one by one. For each world it finds a matching component in `components` and then recurses for the next item in the `worlds` list. Once `worlds` is empty the `test` list, a temporary vector, is cloned and pushed into `commit`.
(
worlds: &[String],
components: &[(Component, PathBuf)],
test: &mut Vec<(Component, PathBuf)>,
commit: &mut dyn FnMut(Vec<(Component, PathBuf)>),
| 797 | /// Once `worlds` is empty the `test` list, a temporary vector, is |
| 798 | /// cloned and pushed into `commit`. |
| 799 | fn push( |
| 800 | worlds: &[String], |
| 801 | components: &[(Component, PathBuf)], |
| 802 | test: &mut Vec<(Component, PathBuf)>, |
| 803 | commit: &mut dyn FnMut(Vec<(Component, PathBuf)>), |
| 804 | ) -> Result<()> { |
| 805 | match worlds.split_first() { |
| 806 | Some((world, rest)) => { |
| 807 | let mut any = false; |
| 808 | for (component, path) in components { |
| 809 | if component.bindgen.world == *world { |
| 810 | any = true; |
| 811 | test.push((component.clone(), path.clone())); |
| 812 | push(rest, components, test, commit)?; |
| 813 | test.pop(); |
| 814 | } |
| 815 | } |
| 816 | if !any { |
| 817 | bail!("no components found for `{world}`"); |
| 818 | } |
| 819 | } |
| 820 | |
| 821 | // No more `worlds`? Then `test` is our set of test components. |
| 822 | None => commit(test.clone()), |
| 823 | } |
| 824 | Ok(()) |
| 825 | } |
| 826 | |
| 827 | push( |
| 828 | &test.config.dependency_worlds(), |
no outgoing calls
no test coverage detected