is it there anything you would like to fix in this code?:


fn run(args: Args) {
    rayon::ThreadPoolBuilder::new()
        .num_threads(args.threads)
        .build_global()
        .unwrap();

    let gtf = reader(&args.gtf).unwrap_or_else(|e| {
        eprintln!("{} {}", "Error:".bright_red().bold(), e);
        std::process::exit(1);
    });
    let records = parallel_parse(&gtf, &args.mode).unwrap_or_else(|e| {
        eprintln!("{} {}", "Error:".bright_red().bold(), e);
        std::process::exit(1);
    });
    let seqs = Fasta::read(&args.fasta).unwrap().records;
    let mut writer = BufWriter::new(File::create(args.out).unwrap());

    // {transcript : (chr, strand, [starts], [ends]))}
    let transcripts: HashMap<String, (String, String, Vec<u32>, Vec<u32>)> = records
        .into_par_iter()
        .fold(
            || HashMap::new(), // local accumulator [per thread]
            |mut local_transcripts, record| {
                let (chr, strand, start, end, transcript) = (
                    record.chr,
                    record.strand,
                    record.start,
                    record.end,
                    record.transcript,
                );

                let entry = local_transcripts
                    .entry(transcript)
                    .or_insert_with(|| (chr.clone(), strand.clone(), Vec::new(), Vec::new()));
                entry.2.push(start);
                entry.3.push(end);

                local_transcripts
            },
        )
        .reduce(
            || HashMap::new(),
            |mut combined_transcripts, local_transcripts| {
                // merge local accs
                for (transcript, (chr, strand, starts, ends)) in local_transcripts {
                    let combined_entry = combined_transcripts
                        .entry(transcript)
                        .or_insert_with(|| (chr, strand, Vec::new(), Vec::new()));
                    combined_entry.2.extend(starts);
                    combined_entry.3.extend(ends);
                }
                combined_transcripts
            },
        );

    for (transcript, (chr, strand, mut starts, mut ends)) in transcripts {
        if !transcript.is_empty() {
            let mut seq = String::new();
            match strand.as_str() {
                "+" => {
                    starts.sort_unstable();
                    ends.sort_unstable();

                    for (i, &start) in starts.iter().enumerate() {
                        let end = ends[i];
                        if let Some(part) = get_sequence(&seqs, &chr, start, end, &strand) {
                            seq.push_str(&String::from_utf8(part).unwrap());
                        }
                    }
                    writeln!(writer, ">{}\n{}", transcript, seq).unwrap();
                }
                "-" => {
                    starts.sort_unstable_by(|a, b| b.cmp(a));
                    ends.sort_unstable_by(|a, b| b.cmp(a));

                    for (i, &start) in starts.iter().enumerate() {
                        let end = ends[i];
                        if let Some(part) = get_sequence(&seqs, &chr, start, end, &strand) {
                            seq.push_str(&String::from_utf8(part).unwrap());
                        }
                    }
                    writeln!(writer, ">{}\n{}", transcript, seq).unwrap();
                }
                _ => (),
            }
        }
    }
}