fn normalize(&mut self) -> Result<()> {
        self.visit_mut(&mut |node: &mut Node| {
            let normalized = match node {
                Node::Tuple(nodes) => {
                    let size = nodes.len();
                    if size <= 1 {
                        return Ok(());
                    }
                    let node0 = &nodes[0];
                    for node in nodes.iter().skip(1) {
                        if node != node0 {
                            return Ok(());
                        }
                    }
                    Node::TupleArray { content: Box::new(std::mem::take(&mut nodes[0])), size }
                }
                _ => {
                    return Ok(());
                }
            };
            *node = normalized;
            Ok(())
        })
    }
/// Remove variable wrappers and compress tuples into TupleArrays where possible. This will
/// fail if any variables are still unknown.
Remove variable wrappers and compress tuples into TupleArrays where possible. This will
fail if any variables are still unknown.
Remove variable wrappers and compress tuples into TupleArrays where possible . This will fail if any variables are still unknown .
fn normalize(&mut self) -> Result<()> {
        self.visit_mut(&mut |node: &mut Node| {
            let normalized = match node {
                Node::Tuple(nodes) => {
                    let size = nodes.len();
                    if size <= 1 {
                        return Ok(());
                    }
                    let node0 = &nodes[0];
                    for node in nodes.iter().skip(1) {
                        if node != node0 {
                            return Ok(());
                        }
                    }
                    Node::TupleArray { content: Box::new(std::mem::take(&mut nodes[0])), size }
                }
                _ => {
                    return Ok(());
                }
            };
            *node = normalized;
            Ok(())
        })
    }
fn normalize ( & mut self ) -> Result < ( ) > { self . visit_mut ( & mut | node : & mut Node | { let normalized = match node { Node :: Tuple ( nodes ) => { let size = nodes . len ( ) ; if size <= 1 { return Ok ( ( ) ) ; } let node0 = & nodes [ 0 ] ; for node in nodes . iter ( ) . skip ( 1 ) { if node != node0 { return Ok ( ( ) ) ; } } Node :: TupleArray { content : Box :: new ( std :: mem :: take ( & mut nodes [ 0 ] ) ) , size } } _ => { return Ok ( ( ) ) ; } } ; * node = normalized ; Ok ( ( ) ) } ) }
Remove variable wrappers and compress tuples into TupleArrays where possible.
Remove variable wrappers and compress tuples into TupleArrays where possible .
&mut self
&mut self