fn handle_file()

in src/producer.rs [53:113]


    fn handle_file<'a>(
        &'a self,
        file: Option<&mut impl Read>,
        path: &Path,
        gcno_stem_archives: &RefCell<FxHashMap<GCNOStem, &'a Archive>>,
        gcda_stem_archives: &RefCell<FxHashMap<String, Vec<&'a Archive>>>,
        profdatas: &RefCell<FxHashMap<String, Vec<&'a Archive>>>,
        profraws: &RefCell<FxHashMap<String, Vec<&'a Archive>>>,
        infos: &RefCell<FxHashMap<String, Vec<&'a Archive>>>,
        xmls: &RefCell<FxHashMap<String, Vec<&'a Archive>>>,
        linked_files_maps: &RefCell<FxHashMap<String, &'a Archive>>,
        is_llvm: bool,
    ) {
        if let Some(ext) = path.extension() {
            match ext.to_str().unwrap() {
                "gcno" => {
                    let llvm = is_llvm || Archive::check_file(file, &Archive::is_gcno_llvm);
                    let filename = clean_path(&path.with_extension(""));
                    gcno_stem_archives.borrow_mut().insert(
                        GCNOStem {
                            stem: filename,
                            llvm,
                        },
                        self,
                    );
                }
                "gcda" => {
                    let filename = clean_path(&path.with_extension(""));
                    self.insert_vec(filename, gcda_stem_archives);
                }
                "profdata" => {
                    let filename = clean_path(path);
                    self.insert_vec(filename, profdatas);
                }
                "profraw" => {
                    let filename = clean_path(path);
                    self.insert_vec(filename, profraws);
                }
                "info" => {
                    if Archive::check_file(file, &Archive::is_info) {
                        let filename = clean_path(path);
                        self.insert_vec(filename, infos);
                    }
                }
                "xml" => {
                    if Archive::check_file(file, &Archive::is_jacoco) {
                        let filename = clean_path(path);
                        self.insert_vec(filename, xmls);
                    }
                }
                "json" => {
                    let filename = path.file_name().unwrap();
                    if filename == "linked-files-map.json" {
                        let filename = clean_path(path);
                        linked_files_maps.borrow_mut().insert(filename, self);
                    }
                }
                _ => {}
            }
        }
    }