// makes a tree from the builder's specific structure
makes a tree from the builder's specific structure
makes a tree from the builder ' s specific structure
fn take(&mut self, out_blines: &[BId]) -> Tree {
        let mut lines: Vec<TreeLine> = Vec::new();
        for id in out_blines.iter() {
            if self.blines[*id].has_match {
                // we need to count the children, so we load them
                if self.blines[*id].file_type.is_dir() && self.blines[*id].children.is_none() {
                    self.load_children(*id);
                }
                if let Ok(tree_line) = self.blines[*id].to_tree_line() {
                    lines.push(tree_line);
                } else {
                    // I guess the file went missing during tree computation
                    warn!(
                        "Error while builind treeline for {:?}",
                        self.blines[*id].path,
                    );
                }
            }
        }
        let mut tree = Tree {
            lines: lines.into_boxed_slice(),
            selection: 0,
            options: self.options.clone(),
            scroll: 0,
            nb_gitignored: self.nb_gitignored,
        };
        tree.after_lines_changed();
        if self.options.show_sizes {
            tree.fetch_file_sizes(); // not the dirs, only simple files
        }
        tree
    }
fn take ( & mut self , out_blines : & [ BId ] ) -> Tree { let mut lines : Vec < TreeLine > = Vec :: new ( ) ; for id in out_blines . iter ( ) { if self . blines [ * id ] . has_match { // we need to count the children, so we load them if self . blines [ * id ] . file_type . is_dir ( ) && self . blines [ * id ] . children . is_none ( ) { self . load_children ( * id ) ; } if let Ok ( tree_line ) = self . blines [ * id ] . to_tree_line ( ) { lines . push ( tree_line ) ; } else { // I guess the file went missing during tree computation warn ! ( " " self blines [ id ] path ) ; } } } let mut tree = Tree { lines : lines . into_boxed_slice ( ) , selection : 0 , options : self . options . clone ( ) , scroll : 0 , nb_gitignored : self . nb_gitignored , } ; tree . after_lines_changed ( ) ; if self . options . show_sizes { tree . fetch_file_sizes ( ) ; // not the dirs, only simple files } tree }
makes a tree from the builder's specific structure
makes a tree from the builder ' s specific structure
&mut self
out_blines
&[BId]