@@ -189,12 +189,6 @@ impl<'a> TomlResolver<'a> {
189189 }
190190}
191191
192- impl AsRef < toml:: Table > for TomlResolver < ' _ > {
193- fn as_ref ( & self ) -> & toml:: Table {
194- self . table . as_ref ( )
195- }
196- }
197-
198192/// The TOML based runtime configuration source Spin CLI.
199193pub struct TomlRuntimeConfigSource < ' a , ' b > {
200194 toml : TomlResolver < ' b > ,
@@ -226,7 +220,7 @@ impl FactorRuntimeConfigSource<KeyValueFactor> for TomlRuntimeConfigSource<'_, '
226220 fn get_runtime_config (
227221 & mut self ,
228222 ) -> anyhow:: Result < Option < spin_factor_key_value:: RuntimeConfig > > {
229- self . key_value . resolve_from_toml ( Some ( self . toml . as_ref ( ) ) )
223+ self . key_value . resolve_from_toml ( Some ( & self . toml . table ) )
230224 }
231225}
232226
@@ -238,17 +232,15 @@ impl FactorRuntimeConfigSource<OutboundNetworkingFactor> for TomlRuntimeConfigSo
238232 let Some ( tls) = self . tls else {
239233 return Ok ( None ) ;
240234 } ;
241- tls. config_from_table ( self . toml . as_ref ( ) )
235+ tls. config_from_table ( & self . toml . table )
242236 }
243237}
244238
245239impl FactorRuntimeConfigSource < VariablesFactor > for TomlRuntimeConfigSource < ' _ , ' _ > {
246240 fn get_runtime_config (
247241 & mut self ,
248242 ) -> anyhow:: Result < Option < <VariablesFactor as spin_factors:: Factor >:: RuntimeConfig > > {
249- Ok ( Some ( variables:: runtime_config_from_toml (
250- self . toml . as_ref ( ) ,
251- ) ?) )
243+ Ok ( Some ( variables:: runtime_config_from_toml ( & self . toml . table ) ?) )
252244 }
253245}
254246
@@ -266,7 +258,7 @@ impl FactorRuntimeConfigSource<OutboundMysqlFactor> for TomlRuntimeConfigSource<
266258
267259impl FactorRuntimeConfigSource < LlmFactor > for TomlRuntimeConfigSource < ' _ , ' _ > {
268260 fn get_runtime_config ( & mut self ) -> anyhow:: Result < Option < spin_factor_llm:: RuntimeConfig > > {
269- llm:: runtime_config_from_toml ( self . toml . as_ref ( ) , self . toml . state_dir ( ) ?, self . use_gpu )
261+ llm:: runtime_config_from_toml ( & self . toml . table , self . toml . state_dir ( ) ?, self . use_gpu )
270262 }
271263}
272264
@@ -296,7 +288,7 @@ impl FactorRuntimeConfigSource<OutboundMqttFactor> for TomlRuntimeConfigSource<'
296288
297289impl FactorRuntimeConfigSource < SqliteFactor > for TomlRuntimeConfigSource < ' _ , ' _ > {
298290 fn get_runtime_config ( & mut self ) -> anyhow:: Result < Option < spin_factor_sqlite:: RuntimeConfig > > {
299- self . sqlite . resolve_from_toml ( self . toml . as_ref ( ) )
291+ self . sqlite . resolve_from_toml ( & self . toml . table )
300292 }
301293}
302294
0 commit comments