|
1 | | -use std::collections::{BTreeMap, HashMap}; |
| 1 | +use std::{ |
| 2 | + collections::{BTreeMap, HashMap}, |
| 3 | + hash::BuildHasher, |
| 4 | +}; |
2 | 5 |
|
3 | 6 | use k8s_openapi::api::core::v1::EnvVar; |
4 | 7 | use product_config::{ProductConfigManager, PropertyValidationResult, types::PropertyNameKind}; |
@@ -171,20 +174,22 @@ pub fn config_for_role_and_group<'a>( |
171 | 174 | /// - `roles`: A map keyed by role names. The value is a tuple of a vector of `PropertyNameKind` |
172 | 175 | /// like (Cli, Env or Files) and [`crate::role_utils::Role`] with a boxed [`Configuration`]. |
173 | 176 | #[allow(clippy::type_complexity)] |
174 | | -pub fn transform_all_roles_to_config<T, U, ProductSpecificCommonConfig>( |
| 177 | +pub fn transform_all_roles_to_config<T, U, ProductSpecificCommonConfig, S>( |
175 | 178 | resource: &T::Configurable, |
176 | 179 | roles: &HashMap< |
177 | 180 | String, |
178 | 181 | ( |
179 | 182 | Vec<PropertyNameKind>, |
180 | 183 | Role<T, U, ProductSpecificCommonConfig>, |
181 | 184 | ), |
| 185 | + S, |
182 | 186 | >, |
183 | 187 | ) -> Result<RoleConfigByPropertyKind> |
184 | 188 | where |
185 | 189 | T: Configuration, |
186 | 190 | U: Default + JsonSchema + Serialize, |
187 | 191 | ProductSpecificCommonConfig: Default + JsonSchema + Serialize, |
| 192 | + S: BuildHasher, |
188 | 193 | { |
189 | 194 | let mut result = HashMap::new(); |
190 | 195 |
|
@@ -570,8 +575,8 @@ where |
570 | 575 | /// env_vars_from_rolegroup_config(&rolegroup_config) |
571 | 576 | /// ); |
572 | 577 | /// ``` |
573 | | -pub fn env_vars_from_rolegroup_config( |
574 | | - rolegroup_config: &HashMap<PropertyNameKind, BTreeMap<String, String>>, |
| 578 | +pub fn env_vars_from_rolegroup_config<S: BuildHasher>( |
| 579 | + rolegroup_config: &HashMap<PropertyNameKind, BTreeMap<String, String>, S>, |
575 | 580 | ) -> Vec<EnvVar> { |
576 | 581 | env_vars_from( |
577 | 582 | rolegroup_config |
|
0 commit comments