pub fn action(&self, relation: &mut MirRelationExpr) {
        if let MirRelationExpr::Project { input, outputs } = relation {
            while let MirRelationExpr::Project {
                input: inner,
                outputs: outputs2,
            } = &mut **input
            {
                *outputs = outputs.iter().map(|i| outputs2[*i]).collect();
                **input = inner.take_dangerous();
            }
            if outputs.iter().enumerate().all(|(a, b)| a == *b) && outputs.len() == input.arity() {
                *relation = input.take_dangerous();
            }
        }
    }
/// Fuses Project operators with parent operators when possible.
Fuses Project operators with parent operators when possible.
Fuses Project operators with parent operators when possible .
pub fn action(&self, relation: &mut MirRelationExpr) {
        if let MirRelationExpr::Project { input, outputs } = relation {
            while let MirRelationExpr::Project {
                input: inner,
                outputs: outputs2,
            } = &mut **input
            {
                *outputs = outputs.iter().map(|i| outputs2[*i]).collect();
                **input = inner.take_dangerous();
            }
            if outputs.iter().enumerate().all(|(a, b)| a == *b) && outputs.len() == input.arity() {
                *relation = input.take_dangerous();
            }
        }
    }
pub fn action ( & self , relation : & mut MirRelationExpr ) { if let MirRelationExpr :: Project { input , outputs } = relation { while let MirRelationExpr :: Project { input : inner , outputs : outputs2 , } = & mut * * input { * outputs = outputs . iter ( ) . map ( | i | outputs2 [ * i ] ) . collect ( ) ; * * input = inner . take_dangerous ( ) ; } if outputs . iter ( ) . enumerate ( ) . all ( | ( a , b ) | a == * b ) && outputs . len ( ) == input . arity ( ) { * relation = input . take_dangerous ( ) ; } } }
Fuses Project operators with parent operators when possible.
Fuses Project operators with parent operators when possible .
&self
relation
&mut MirRelationExpr
&self
relation
&mut MirRelationExpr