File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -19,20 +19,22 @@ use spin_factor_variables::runtime_config::RuntimeConfig;
19
19
/// Resolves a runtime configuration for the variables factor from a TOML table.
20
20
pub fn runtime_config_from_toml ( table : & impl GetTomlValue ) -> anyhow:: Result < RuntimeConfig > {
21
21
// Always include the environment variable provider.
22
- let mut providers = vec ! [ Box :: <EnvVariablesProvider >:: default ( ) as _] ;
22
+ let var_provider = vec ! [ Box :: <EnvVariablesProvider >:: default ( ) as _] ;
23
23
let value = table
24
24
. get ( "variables_provider" )
25
25
. or_else ( || table. get ( "config_provider" ) ) ;
26
26
let Some ( array) = value else {
27
- return Ok ( RuntimeConfig { providers } ) ;
27
+ return Ok ( RuntimeConfig {
28
+ providers : var_provider,
29
+ } ) ;
28
30
} ;
29
31
30
32
let provider_configs: Vec < VariableProviderConfiguration > = array. clone ( ) . try_into ( ) ?;
31
- let new_providers = provider_configs
33
+ let mut providers = provider_configs
32
34
. into_iter ( )
33
35
. map ( VariableProviderConfiguration :: into_provider)
34
36
. collect :: < anyhow:: Result < Vec < _ > > > ( ) ?;
35
- providers. extend ( new_providers ) ;
37
+ providers. extend ( var_provider ) ;
36
38
Ok ( RuntimeConfig { providers } )
37
39
}
38
40
You can’t perform that action at this time.
0 commit comments