File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -82,9 +82,11 @@ impl fmt::Debug for EnvVarsMapping {
8282 }
8383}
8484
85- impl From < InnerMappingHandlers > for EnvVarsMapping {
86- fn from ( x : InnerMappingHandlers ) -> Self {
87- Self {
85+ impl TryFrom < InnerMappingHandlers > for EnvVarsMapping {
86+ type Error = anyhow:: Error ;
87+
88+ fn try_from ( x : InnerMappingHandlers ) -> Result < Self , Self :: Error > {
89+ let vars = Self {
8890 entity_cache_dead_weight : x. entity_cache_dead_weight . 0 ,
8991 entity_cache_size : x. entity_cache_size_in_kb * 1000 ,
9092
@@ -102,7 +104,8 @@ impl From<InnerMappingHandlers> for EnvVarsMapping {
102104 allow_non_deterministic_ipfs : x. allow_non_deterministic_ipfs . 0 ,
103105 disable_declared_calls : x. disable_declared_calls . 0 ,
104106 store_errors_are_nondeterministic : x. store_errors_are_nondeterministic . 0 ,
105- }
107+ } ;
108+ Ok ( vars)
106109 }
107110}
108111
Original file line number Diff line number Diff line change @@ -268,7 +268,7 @@ impl EnvVars {
268268 pub fn from_env ( ) -> Result < Self , anyhow:: Error > {
269269 let inner = Inner :: init_from_env ( ) ?;
270270 let graphql = InnerGraphQl :: init_from_env ( ) ?. into ( ) ;
271- let mapping_handlers = InnerMappingHandlers :: init_from_env ( ) ?. into ( ) ;
271+ let mapping_handlers = InnerMappingHandlers :: init_from_env ( ) ?. try_into ( ) ? ;
272272 let store = InnerStore :: init_from_env ( ) ?. try_into ( ) ?;
273273 let ipfs_request_timeout = match inner. ipfs_request_timeout {
274274 Some ( timeout) => Duration :: from_secs ( timeout) ,
You can’t perform that action at this time.
0 commit comments