pub fn parse_prs(github_entries: Vec<PullRequest>, homu_entries: Vec<Entry>) -> HashMap<u32, Pr> {
    let mut prs = HashMap::new();

    for mut gh in github_entries {
        let commit = gh.commits.nodes.swap_remove(0).commit;
        let ci_status = commit
            .status
            .into_iter()
            .flat_map(|status| status.contexts)
            .chain(
                commit
                    .check_suites
                    .nodes
                    .into_iter()
                    .flat_map(|suite| suite.check_runs.nodes)
                    .map(Into::into),
            )
            .collect::<Vec<_>>();

        prs.insert(
            gh.number,
            Pr {
                author: gh.author.login,
                created_at: gh.created_at,
                updated_at: gh.updated_at,
                mergeable: gh.mergeable,
                title: gh.title,
                labels: gh.labels.nodes,
                ci_status,
                additions: gh.additions,
                deletions: gh.deletions,
                base_ref_name: gh.base_ref_name,
                head_ref_name: gh.head_ref_name,
                body: gh.body,
                ..Pr::default()
            },
        );
    }

    for h in homu_entries {
        let title = h.title;
        let pr = prs.entry(h.number).or_insert_with(move || Pr {
            title,
            ..Pr::default()
        });
        pr.status = h.status;
        pr.is_trying = h.is_trying;
        pr.priority = h.priority;
        pr.approver = h.approver;
    }

    prs
}
/// Combines information from GitHub and Homu to get a list of pull request information.
Combines information from GitHub and Homu to get a list of pull request information.
Combines information from GitHub and Homu to get a list of pull request information .
pub fn parse_prs(github_entries: Vec<PullRequest>, homu_entries: Vec<Entry>) -> HashMap<u32, Pr> {
    let mut prs = HashMap::new();
    for mut gh in github_entries {
        let commit = gh.commits.nodes.swap_remove(0).commit;
        let ci_status = commit
            .status
            .into_iter()
            .flat_map(|status| status.contexts)
            .chain(
                commit
                    .check_suites
                    .nodes
                    .into_iter()
                    .flat_map(|suite| suite.check_runs.nodes)
                    .map(Into::into),
            )
            .collect::<Vec<_>>();
        prs.insert(
            gh.number,
            Pr {
                author: gh.author.login,
                created_at: gh.created_at,
                updated_at: gh.updated_at,
                mergeable: gh.mergeable,
                title: gh.title,
                labels: gh.labels.nodes,
                ci_status,
                additions: gh.additions,
                deletions: gh.deletions,
                base_ref_name: gh.base_ref_name,
                head_ref_name: gh.head_ref_name,
                body: gh.body,
                ..Pr::default()
            },
        );
    }
    for h in homu_entries {
        let title = h.title;
        let pr = prs.entry(h.number).or_insert_with(move || Pr {
            title,
            ..Pr::default()
        });
        pr.status = h.status;
        pr.is_trying = h.is_trying;
        pr.priority = h.priority;
        pr.approver = h.approver;
    }
    prs
}
pub fn parse_prs ( github_entries : Vec < PullRequest > , homu_entries : Vec < Entry > ) -> HashMap < u32 , Pr > { let mut prs = HashMap :: new ( ) ; for mut gh in github_entries { let commit = gh . commits . nodes . swap_remove ( 0 ) . commit ; let ci_status = commit . status . into_iter ( ) . flat_map ( | status | status . contexts ) . chain ( commit . check_suites . nodes . into_iter ( ) . flat_map ( | suite | suite . check_runs . nodes ) . map ( Into :: into ) , ) . collect :: < Vec < _ > > ( ) ; prs . insert ( gh . number , Pr { author : gh . author . login , created_at : gh . created_at , updated_at : gh . updated_at , mergeable : gh . mergeable , title : gh . title , labels : gh . labels . nodes , ci_status , additions : gh . additions , deletions : gh . deletions , base_ref_name : gh . base_ref_name , head_ref_name : gh . head_ref_name , body : gh . body , .. Pr :: default ( ) } , ) ; } for h in homu_entries { let title = h . title ; let pr = prs . entry ( h . number ) . or_insert_with ( move | | Pr { title , .. Pr :: default ( ) } ) ; pr . status = h . status ; pr . is_trying = h . is_trying ; pr . priority = h . priority ; pr . approver = h . approver ; } prs }
Combines information from GitHub and Homu to get a list of pull request information.
Combines information from GitHub and Homu to get a list of pull request information .
github_entries
Vec<PullRequest>
homu_entries
Vec<Entry>
github_entries
Vec<PullRequest>
homu_entries
Vec<Entry>