please check this code:


fn main() {
    let start = std::time::Instant::now();

    let file = "/home/alejandro/Downloads/gencode.v44.annotation.gtf";

    let contents = reader(file).unwrap();
    let records = parallel_parse(&contents).unwrap();

    let elapsed = start.elapsed();
    println!("{:?}", records);
    println!("Elapsed: {:?}", elapsed);
}

pub type ProtRecord = HashMap<String, InnerProtRecord>;

#[derive(Debug, PartialEq)]
pub struct InnerProtRecord {
    pub chr: String,
    pub strand: char,
    pub start: u32,
    pub end: u32,
}

impl Default for InnerProtRecord {
    fn default() -> Self {
        InnerProtRecord {
            chr: String::new(),
            strand: ' ',
            start: 0,
            end: 0,
        }
    }
}

pub fn reader<P: AsRef<Path> + Debug>(file: P) -> io::Result<String> {
    let mut file = File::open(file)?;
    let mut contents = String::new();
    file.read_to_string(&mut contents)?;
    Ok(contents)
}

pub fn parallel_parse<'a>(s: &'a str) -> Result<ProtRecord, &'static str> {
    let x = s
        .par_lines()
        .filter(|line| !line.starts_with("#"))
        .filter_map(|line| Record::parse(line).ok())
        .filter(|record| record.feat == "CDS")
        .fold(
            || HashMap::new(),
            |mut acc: ProtRecord, record| {
                // acc.entry(record.chr.clone()).or_default().push(record);
                let k = acc.entry(record.attr.protein_id).or_default();
                if !k.chr.is_empty() {
                    k.start = k.start.min(record.start);
                    k.end = k.end.max(record.end);
                } else {
                    InnerProtRecord {
                        chr: record.chr,
                        strand: record.strand,
                        start: record.start,
                        end: record.end,
                    };
                };

                acc
            },
        )
        .reduce(
            || HashMap::new(),
            |mut acc, map| {
                for (k, v) in map {
                    let x = acc.entry(k).or_default();
                    if !x.chr.is_empty() {
                        x.start = x.start.min(v.start);
                        x.end = x.end.max(v.end);
                    } else {
                        *x = v;
                    }
                }

                acc
            },
        );

    Ok(x)
}

why am I getting this output?:

{"ENSP00000503594.1": InnerProtRecord { chr: "", strand: ' ', start: 0, end: 0 }, "ENSP00000294168.3": InnerProtRecord { chr: "", strand: ' ', start: 0, end: 0 }, "ENSP00000502566.1": InnerProtRecord { chr: "", strand: ' ', start: 0, end: 0 }, "ENSP00000421719.1": InnerProtRecord { chr: "", strand: ' ', start: 0, end: 0 }, "ENSP00000359732.3": InnerProtRecord { chr: "", strand: ' ', start: 0, end: 0 }, "ENSP00000450699.1": InnerProtRecord { chr: "", strand: ' ', start: 0, end: 0 }, "ENSP00000490285.1": InnerProtRecord { chr: "", strand: ' ', start: 0, end: 0 }, "ENSP00000486606.1": InnerProtRecord { chr: "", strand: ' ', start: 0, end: 0 }, "ENSP00000492123.1": InnerProtRecord { chr: "", strand: ' ', start: 0, end: 0 }, "ENSP00000392760.2": InnerProtRecord { chr: "", strand: ' ', start: 0, end: 0 }, "ENSP00000475284.1": InnerProtRecord { chr: "", strand: ' ', start: 0, end: 0 }, "ENSP00000420359.2": InnerProtRecord { chr: "", strand: ' ', start: 0, end: 0 }, "ENSP00000426304.1": InnerProtRecord { chr: "", strand: ' ', start: 0, end: 0 }, "ENSP00000489204.1": InnerProtRecord { chr: "", strand: ' ', start: 0, end: 0 }, "ENSP00000495022.2": InnerProtRecord { chr: "", strand: ' ', start: 0, end: 0 }, "ENSP00000383896.1": InnerProtRecord { chr: "", strand: ' ', start: 0, end: 0 }, "ENSP00000380734.2": InnerProtRecord { chr: "", strand: ' ', start: 0, end: 0 

like if each entry does not have information