@@ -85,11 +85,10 @@ impl InProcessResolver {
8585 context : & EvaluationContext ,
8686 value_converter : impl Fn ( & OpenFeatureValue ) -> Option < T > ,
8787 ) -> Option < T > {
88- if let Some ( cache) = & self . cache {
89- if let Some ( cached_value) = cache. get ( flag_key, context) . await {
88+ if let Some ( cache) = & self . cache
89+ && let Some ( cached_value) = cache. get ( flag_key, context) . await {
9090 return value_converter ( & cached_value) ;
9191 }
92- }
9392 None
9493 }
9594
@@ -117,7 +116,7 @@ impl InProcessResolver {
117116 OpenFeatureValue :: Array ( arr) => {
118117 // Convert OpenFeature array to JsonValue array
119118 let json_array =
120- JsonValue :: Array ( arr. iter ( ) . map ( |v| convert_to_json_value ( v ) ) . collect ( ) ) ;
119+ JsonValue :: Array ( arr. iter ( ) . map ( convert_to_json_value) . collect ( ) ) ;
121120 value_converter ( & json_array)
122121 }
123122 } )
@@ -309,7 +308,7 @@ fn convert_to_json_value(value: &OpenFeatureValue) -> JsonValue {
309308 OpenFeatureValue :: Float ( f) => JsonValue :: Number ( serde_json:: Number :: from_f64 ( * f) . unwrap ( ) ) ,
310309 OpenFeatureValue :: Struct ( s) => convert_struct_to_json ( s) ,
311310 OpenFeatureValue :: Array ( arr) => {
312- JsonValue :: Array ( arr. iter ( ) . map ( |v| convert_to_json_value ( v ) ) . collect ( ) )
311+ JsonValue :: Array ( arr. iter ( ) . map ( convert_to_json_value) . collect ( ) )
313312 }
314313 }
315314}
0 commit comments