Map over the internal and external target configurations to find a first non-empty result.
(&self, f: F, g: G)
| 272 | impl<'a, M: Materials> SubmitConfig<'a, M> { |
| 273 | /// Map over the internal and external target configurations to find a first non-empty result. |
| 274 | pub fn find_node<F, G, T>(&self, f: F, g: G) -> Option<T> |
| 275 | where |
| 276 | F: Fn(&M::Node) -> Option<T>, |
| 277 | G: Fn(&Url) -> Option<T>, |
| 278 | { |
| 279 | self.nodes |
| 280 | .iter() |
| 281 | .filter_map(|tc| match tc { |
| 282 | TargetConfig::Internal(n) => f(n), |
| 283 | TargetConfig::External(u) => g(u), |
| 284 | }) |
| 285 | .next() |
| 286 | } |
| 287 | } |
no test coverage detected