diff --git a/crates/variables/src/lib.rs b/crates/variables/src/lib.rs index f5857e0d0..79130aeaf 100644 --- a/crates/variables/src/lib.rs +++ b/crates/variables/src/lib.rs @@ -19,20 +19,22 @@ use spin_factor_variables::runtime_config::RuntimeConfig; /// Resolves a runtime configuration for the variables factor from a TOML table. pub fn runtime_config_from_toml(table: &impl GetTomlValue) -> anyhow::Result { // Always include the environment variable provider. - let mut providers = vec![Box::::default() as _]; + let var_provider = vec![Box::::default() as _]; let value = table .get("variables_provider") .or_else(|| table.get("config_provider")); let Some(array) = value else { - return Ok(RuntimeConfig { providers }); + return Ok(RuntimeConfig { + providers: var_provider, + }); }; let provider_configs: Vec = array.clone().try_into()?; - let new_providers = provider_configs + let mut providers = provider_configs .into_iter() .map(VariableProviderConfiguration::into_provider) .collect::>>()?; - providers.extend(new_providers); + providers.extend(var_provider); Ok(RuntimeConfig { providers }) }