fn shrink_unchanged_delimiters<'a>(
    lhs_nodes: &[&'a Syntax<'a>],
    rhs_nodes: &[&'a Syntax<'a>],
) -> (bool, Vec<&'a Syntax<'a>>, Vec<&'a Syntax<'a>>) {
    if let (
        [Syntax::List {
            open_content: lhs_open,
            children: lhs_children,
            close_content: lhs_close,
            ..
        }],
        [Syntax::List {
            open_content: rhs_open,
            children: rhs_children,
            close_content: rhs_close,
            ..
        }],
    ) = (lhs_nodes, rhs_nodes)
    {
        if lhs_open == rhs_open && lhs_close == rhs_close {
            let (changed_later, lhs_shrunk_nodes, rhs_shrunk_nodes) =
                shrink_unchanged_at_ends(lhs_children, rhs_children);
            if changed_later {
                lhs_nodes[0].set_change(ChangeKind::Unchanged(rhs_nodes[0]));
                rhs_nodes[0].set_change(ChangeKind::Unchanged(lhs_nodes[0]));
                return (true, lhs_shrunk_nodes, rhs_shrunk_nodes);
            }
        }
    }

    (false, Vec::from(lhs_nodes), Vec::from(rhs_nodes))
}
/// If we're comparing two lists that have the same delimiters, mark
/// the delimiters as unchanged and return the children.
If we're comparing two lists that have the same delimiters, mark
the delimiters as unchanged and return the children.
If we ' re comparing two lists that have the same delimiters mark the delimiters as unchanged and return the children .
fn shrink_unchanged_delimiters<'a>(
    lhs_nodes: &[&'a Syntax<'a>],
    rhs_nodes: &[&'a Syntax<'a>],
) -> (bool, Vec<&'a Syntax<'a>>, Vec<&'a Syntax<'a>>) {
    if let (
        [Syntax::List {
            open_content: lhs_open,
            children: lhs_children,
            close_content: lhs_close,
            ..
        }],
        [Syntax::List {
            open_content: rhs_open,
            children: rhs_children,
            close_content: rhs_close,
            ..
        }],
    ) = (lhs_nodes, rhs_nodes)
    {
        if lhs_open == rhs_open && lhs_close == rhs_close {
            let (changed_later, lhs_shrunk_nodes, rhs_shrunk_nodes) =
                shrink_unchanged_at_ends(lhs_children, rhs_children);
            if changed_later {
                lhs_nodes[0].set_change(ChangeKind::Unchanged(rhs_nodes[0]));
                rhs_nodes[0].set_change(ChangeKind::Unchanged(lhs_nodes[0]));
                return (true, lhs_shrunk_nodes, rhs_shrunk_nodes);
            }
        }
    }
    (false, Vec::from(lhs_nodes), Vec::from(rhs_nodes))
}
fn shrink_unchanged_delimiters < ' a > ( lhs_nodes : & [ & ' a Syntax < ' a > ] , rhs_nodes : & [ & ' a Syntax < ' a > ] , ) -> ( bool , Vec < & ' a Syntax < ' a > > , Vec < & ' a Syntax < ' a > > ) { if let ( [ Syntax :: List { open_content : lhs_open , children : lhs_children , close_content : lhs_close , .. } ] , [ Syntax :: List { open_content : rhs_open , children : rhs_children , close_content : rhs_close , .. } ] , ) = ( lhs_nodes , rhs_nodes ) { if lhs_open == rhs_open && lhs_close == rhs_close { let ( changed_later , lhs_shrunk_nodes , rhs_shrunk_nodes ) = shrink_unchanged_at_ends ( lhs_children , rhs_children ) ; if changed_later { lhs_nodes [ 0 ] . set_change ( ChangeKind :: Unchanged ( rhs_nodes [ 0 ] ) ) ; rhs_nodes [ 0 ] . set_change ( ChangeKind :: Unchanged ( lhs_nodes [ 0 ] ) ) ; return ( true , lhs_shrunk_nodes , rhs_shrunk_nodes ) ; } } } ( false , Vec :: from ( lhs_nodes ) , Vec :: from ( rhs_nodes ) ) }
If we're comparing two lists that have the same delimiters, mark
the delimiters as unchanged and return the children.
If we ' re comparing two lists that have the same delimiters mark the delimiters as unchanged and return the children .
lhs_nodes
&[&'a Syntax<'a>]
rhs_nodes
&[&'a Syntax<'a>]