fn walk<F>(&self, node: &Node, props: InheritProps, device_node_op: &mut F)
    where
        F: FnMut(&Node, &StringList, &InheritProps),
    {
        let mut props = props;
        if let Ok(num) = node.prop_u32("interrupt-parent") {
            props.interrupt_parent = num;
        }

        if let Ok(comp) = node.prop_str_list("compatible") {
            device_node_op(node, &comp, &props);
        }

        props.parent_address_cells = node.prop_u32("#address-cells").unwrap_or(0);
        props.parent_size_cells = node.prop_u32("#size-cells").unwrap_or(0);
        // DFS
        for child in node.children.iter() {
            self.walk(child, props, device_node_op);
        }
    }
/// Traverse the tree by DFS, collect necessary properties, and apply the
/// `device_node_op` to each node.
Traverse the tree by DFS, collect necessary properties, and apply the
`device_node_op` to each node.
Traverse the tree by DFS collect necessary properties and apply the ` device_node_op ` to each node .
fn walk<F>(&self, node: &Node, props: InheritProps, device_node_op: &mut F)
    where
        F: FnMut(&Node, &StringList, &InheritProps),
    {
        let mut props = props;
        if let Ok(num) = node.prop_u32("interrupt-parent") {
            props.interrupt_parent = num;
        }
        if let Ok(comp) = node.prop_str_list("compatible") {
            device_node_op(node, &comp, &props);
        }
        props.parent_address_cells = node.prop_u32("#address-cells").unwrap_or(0);
        props.parent_size_cells = node.prop_u32("#size-cells").unwrap_or(0);
        // DFS
        for child in node.children.iter() {
            self.walk(child, props, device_node_op);
        }
    }
fn walk < F > ( & self , node : & Node , props : InheritProps , device_node_op : & mut F ) where F : FnMut ( & Node , & StringList , & InheritProps ) , { let mut props = props ; if let Ok ( num ) = node . prop_u32 ( " " ) { props . interrupt_parent = num ; } if let Ok ( comp ) = node . prop_str_list ( " " ) { device_node_op ( node , & comp , & props ) ; } props . parent_address_cells = node . prop_u32 ( " " ) . unwrap_or ( 0 ) ; props . parent_size_cells = node . prop_u32 ( " " ) . unwrap_or ( 0 ) ; // DFS for child in node . children . iter ( ) { self . walk ( child , props , device_node_op ) ; } }
Traverse the tree by DFS, collect necessary properties, and apply the
`device_node_op` to each node.
Traverse the tree by DFS collect necessary properties and apply the ` device_node_op ` to each node .
&self
node
&Node
props
InheritProps
device_node_op
&mut F
&self
node
&Node
props
InheritProps
device_node_op
&mut F