File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -82,9 +82,11 @@ impl fmt::Debug for EnvVarsMapping {
82
82
}
83
83
}
84
84
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 {
88
90
entity_cache_dead_weight : x. entity_cache_dead_weight . 0 ,
89
91
entity_cache_size : x. entity_cache_size_in_kb * 1000 ,
90
92
@@ -102,7 +104,8 @@ impl From<InnerMappingHandlers> for EnvVarsMapping {
102
104
allow_non_deterministic_ipfs : x. allow_non_deterministic_ipfs . 0 ,
103
105
disable_declared_calls : x. disable_declared_calls . 0 ,
104
106
store_errors_are_nondeterministic : x. store_errors_are_nondeterministic . 0 ,
105
- }
107
+ } ;
108
+ Ok ( vars)
106
109
}
107
110
}
108
111
Original file line number Diff line number Diff line change @@ -268,7 +268,7 @@ impl EnvVars {
268
268
pub fn from_env ( ) -> Result < Self , anyhow:: Error > {
269
269
let inner = Inner :: init_from_env ( ) ?;
270
270
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 ( ) ? ;
272
272
let store = InnerStore :: init_from_env ( ) ?. try_into ( ) ?;
273
273
let ipfs_request_timeout = match inner. ipfs_request_timeout {
274
274
Some ( timeout) => Duration :: from_secs ( timeout) ,
You can’t perform that action at this time.
0 commit comments