Extract a string value from the template's `platform_config` Struct.
(template: &SandboxTemplate, key: &str)
| 2090 | |
| 2091 | /// Extract a string value from the template's `platform_config` Struct. |
| 2092 | fn platform_config_string(template: &SandboxTemplate, key: &str) -> Option<String> { |
| 2093 | let config = template.platform_config.as_ref()?; |
| 2094 | let value = config.fields.get(key)?; |
| 2095 | match value.kind.as_ref() { |
| 2096 | Some(prost_types::value::Kind::StringValue(s)) if !s.is_empty() => Some(s.clone()), |
| 2097 | _ => None, |
| 2098 | } |
| 2099 | } |
| 2100 | |
| 2101 | fn platform_config_bool(template: &SandboxTemplate, key: &str) -> Option<bool> { |
| 2102 | let config = template.platform_config.as_ref()?; |
no test coverage detected