// Make sure our focus is valid.
Make sure our focus is valid.
Make sure our focus is valid .
fn validate_focus(focus: &Focus) -> bool {
    assert!(focus.indexes.len() > 0);
    assert!(Rc::ptr_eq(
        &focus.parent_node[*focus.indexes.last().unwrap()],
        &focus.current_node
    ));
    let mut curr = Rc::clone(&focus.current_node);
    let mut parent = focus.current_node.parent();
    for (i, index) in focus.indexes.iter().rev().enumerate() {
        assert!(Rc::ptr_eq(&parent[*index], &curr));
        if i < focus.indexes.len() - 1 {
            curr = parent;
            parent = curr.parent();
        }
    }
    true
}
fn validate_focus ( focus : & Focus ) -> bool { assert ! ( focus indexes len ( ) 0 ) ; assert ! ( Rc ptr_eq ( focus parent_node [ focus indexes last ( ) unwrap ( ) ] focus current_node ) ) ; let mut curr = Rc :: clone ( & focus . current_node ) ; let mut parent = focus . current_node . parent ( ) ; for ( i , index ) in focus . indexes . iter ( ) . rev ( ) . enumerate ( ) { assert ! ( Rc ptr_eq ( parent [ index ] curr ) ) ; if i < focus . indexes . len ( ) - 1 { curr = parent ; parent = curr . parent ( ) ; } } true }
Make sure our focus is valid.
Make sure our focus is valid .
focus
&Focus