@@ -3,7 +3,7 @@ use crate::config;
33use crate :: config:: { ExprBody , Field , If } ;
44use crate :: lambda:: { Expression , List , Logic , Math , Relation } ;
55use crate :: try_fold:: TryFold ;
6- use crate :: valid:: Valid ;
6+ use crate :: valid:: { Valid , Validator } ;
77
88struct CompilationContext < ' a > {
99 config_field : & ' a config:: Field ,
@@ -78,9 +78,9 @@ fn compile(ctx: &CompilationContext, expr: ExprBody) -> Valid<Expression, String
7878 ExprBody :: If ( If { ref cond, on_true : ref then, on_false : ref els } ) => {
7979 compile ( ctx, * cond. clone ( ) )
8080 . map ( Box :: new)
81- . zip ( compile ( ctx, * then. clone ( ) ) . map ( Box :: new) )
82- . zip ( compile ( ctx, * els. clone ( ) ) . map ( Box :: new) )
83- . map ( |( ( cond, then) , els) | {
81+ . fuse ( compile ( ctx, * then. clone ( ) ) . map ( Box :: new) )
82+ . fuse ( compile ( ctx, * els. clone ( ) ) . map ( Box :: new) )
83+ . map ( |( cond, then, els) | {
8484 Expression :: Logic ( Logic :: If { cond, then, els } ) . parallel_when ( expr. has_io ( ) )
8585 } )
8686 }
@@ -181,6 +181,7 @@ mod tests {
181181 use crate :: config:: { ConfigSet , Expr , Field , GraphQLOperationType } ;
182182 use crate :: http:: RequestContext ;
183183 use crate :: lambda:: { Concurrent , Eval , EvaluationContext , ResolverContextLike } ;
184+ use crate :: valid:: Validator ;
184185
185186 #[ derive( Default ) ]
186187 struct Context < ' a > {
0 commit comments