(self)
| 401 | } |
| 402 | |
| 403 | pub fn build(self) -> Result<HarnessRegistry, HarnessRegistryBuildError> { |
| 404 | let mut provider_ids = HashSet::new(); |
| 405 | for provider in &self.providers { |
| 406 | if !provider_ids.insert(provider.id().clone()) { |
| 407 | return Err(HarnessRegistryBuildError::DuplicateProviderId { |
| 408 | provider_id: provider.id().clone(), |
| 409 | }); |
| 410 | } |
| 411 | } |
| 412 | |
| 413 | Ok(HarnessRegistry { |
| 414 | providers: self.providers, |
| 415 | }) |
| 416 | } |
| 417 | } |
| 418 | |
| 419 | #[derive(Default)] |